Same topic name in different cluster and different environment

I observed that in a single/multiple environment for different cluster I can create topic with same name. In that case how the uniqueness works for consumers to reach the specific topic of a cluster. Since the bootstrap endpoint which is shown for both cluster on diff environment are same.

I have different cluster of DEV and PREPROD on separate env, I could create same topic with same name in both cluster. In consumer configuration all endpoint and topic name remains same.

Should I create different API key to differentiate where the consumer should push message to ?

Its confusing how the uniqueness is addressed here since endpoint, topic name remains same. Is that a bad practice not to have unique topic names in your entire organisation account in conf cloud.

Yes, you have to do this because Kafka API keys are scoped to one Kafka cluster. There’s no sharing. It’s a similar story with OAuth 2, though the cluster scoping is done differently (see the logicalCluster SASL extension described here).

No, using the same topic name across clusters isn’t a bad practice. One thing to be aware of is that Schema Registry in Confluent Cloud is scoped to an environment so beware of potential subject name collisions.