【发布时间】:2022-02-18 01:46:20
【问题描述】:
commandProcessors-in-0:
destination: internal-command-processor
consumer:
max-attempts: 1
group: command-processor-group
retrieveCohort-in-0:
destination: internal-retrieve-cohort
consumer:
max-attempts: 1
batch-mode: true
group: retrieve-cohort-group
我输入了不同的类似消费者的配置,其中一个可能将批处理模式设置为 true,而另一个则没有。
在我的ListenerContainerCustomizer 中,我想知道他们是否将批处理模式设置为 true。
@Bean
ListenerContainerCustomizer<AbstractMessageListenerContainer<?, ?>> customizer( ){
return (container, dest, group) -> {
if (dest.equals("internal-generate-stop-reason")) {
container.setBatchErrorHandler(new RetryingBatchErrorHandler(new FixedBackOff(5000L, 2L),
new DeadLetterPublishingRecoverer(kafkaTemplate(),
(rec, ex) -> new TopicPartition("error-dlq", rec.partition()))));
} else {
System.out.println(dest+" => "+container.getAssignmentsByClientId());
}
};
}
【问题讨论】:
标签: apache-kafka apache-kafka-streams spring-kafka kafka-streams-binder