【问题标题】:Reactive kafka Keep getting Timeout exception while producing mesage反应式卡夫卡在产生消息时不断收到超时异常
【发布时间】:2021-09-19 06:16:13
【问题描述】:
尝试在 kafka 上生成消息时不断收到 log:reactor.core.Exceptions$ErrorCallbackNotImplemented: org.apache.kafka.common.errors.TimeoutException: Topic topic not present in metadata after 60000 ms. Caused by: org.apache.kafka.common.errors.TimeoutException: Topic topic not present in metadata after 60000 ms.。
已经确保我在生产者项目中有 Jackson 核心、Jackson 数据绑定和 Kafka 客户端依赖项。另外我如何在反应堆 kafka SenderOptions 中传递安全协议
【问题讨论】:
标签:
apache-kafka
spring-kafka
kafka-producer-api
reactor-kafka
【解决方案1】:
Topic topic not present in metadata after 60000 ms. 您必须先创建主题,然后才能使用它 - 使用命令行工具或 AdminClient。
您可以在传递到create() 的映射中设置任何ProducerConfig 属性。
/**
* Creates a sender options instance with the specified config overrides for the underlying
* Kafka {@link Producer}.
* @return new instance of sender options
*/
@NonNull
static <K, V> SenderOptions<K, V> create(@NonNull Map<String, Object> configProperties) {
return new ImmutableSenderOptions<>(configProperties);
}