Search code examples
apache-kafkakafka-consumer-apiapache-kafka-streams

Kafka Streams - disable internal topic creation


I work in an organization where we must use the shared Kafka cluster.
Due to internal company policy, the account we use for authentication has only the read/write permissions assigned.
We are not able to request the topic-create permission.
To create the topic we need to follow the onboarding procedure and know the topic name upfront.

As we know, Kafka Streams creates internal topics to persist the stream's state.

Is there a way to disable the fault tolerance and keep the stream state in memory or persist in the file system?

Thank you in advance.


Solution

  • This entirely depends how you write the topology. For example, map/filter/forEach, etc stateless DSL operators don't create any internal topics.

    If you actually need to do aggregation, and build state-stores, then you really shouldn't disable topics, assuming you could. Yes, statestores are stored either in-memory or as RocksDB on disk, but they're still initially stored as topics so they can actually be distributed, or rebuilt in case of failure.

    If you want to prevent them, I think you'll need an authorizer class defined on the broker that can restrict topic creation based, at least, on client side application.id and client.id regex patterns, but there's nothing you can do at the client config.