Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
590 views
in Technique[技术] by (71.8m points)

apache kafka - Exception for non-existent topic in MassTransit

When topic in Kafka doesn't exist and there is an endpoint configuration done for it with TopicEndpoint method, it throws an exception: Confluent.Kafka.ConsumeException: Broker: Unknown topic or partition. After the topic is created, the exception doesn't occur anymore. How to set up the automatic topic creation for endpoints configured with TopicEndpoint method?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Automatic topic creation is not currently supported, and based on experience with a number of enterprises using Kafka, they don't recommend it either. Typically it is something that is managed so that proper partitioning and ownership can be applied to the topic (rather than just guessing).

In fact, I'm not sure it's even possible for a Kafka consumer (using the Confluent client) to automatically create the topic. There are aspects such as the schema registry, etc. that are taken into consideration as well.

I am open to the discussion, but the choices made were based upon interviewing teams using Kafka who said they wouldn't usually allow topics to be created automatically.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...