Kafka topics cannot be renamed, but KafkaTopic's spec.topicName has changed

Solution Verified - Updated -

Issue

  • We have initially created a Kafka topic using the following CR:
kind: KafkaTopic  
metadata:
   name: mytopic-20-21 
spec:
   topicName: mytopic_20-21

Later on, we had to rename the topicName. As it's not possible to update the name of a Topic in Kafka, we have deleted it first and then created it again with the new CRD (we have removed one underscore character from the topicName):

kind: KafkaTopic  
metadata:
   name: mytopic-20-21 
spec:
   topicName: mytopic-20-21

As a result, the following Exception is raised: java.lang.IllegalArgumentException: Kafka topics cannot be renamed, but KafkaTopic's spec.topicName has changed.

Environment

  • AMQ Streams
    • 2.0.1
  • OpenShift Container Platform
    • 4.8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content