MassTransit 中不存在主题的异常

Exception for non-existent topic in MassTransit

当 Kafka 中的主题不存在并且使用 TopicEndpoint 方法为其完成端点配置时,它会抛出异常: Confluent.Kafka.ConsumeException: Broker: Unknown topic or partition。 创建主题后,不再出现异常。如何为使用 TopicEndpoint 方法配置的端点设置自动主题创建?

目前不支持自动创建主题,根据多家企业使用Kafka的经验,他们也不推荐。通常它是经过管理的东西,以便可以将适当的分区和所有权应用于主题(而不是仅仅猜测)。

事实上,我不确定 Kafka 消费者(使用 Confluent 客户端)是否有可能自动创建主题。模式注册表等方面也被考虑在内。

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.