@KafkaListener 和一个消费者
@KafkaListener and one single Consumer
我有这个方法
@KafkaListener(topics={"one", "two", "three"})
public void listen(String message) { ...}
监听器容器如何独立于主题和分区只实例化一个消费者。
例如,如果我有这些分区:
one-0
one-1
two-0
three-0
three-1
有没有办法将所有这些分区分配给同一个消费者?
ConcurrentKafkaListenerContainerFactory
的并发值 1 是否足以满足此目的?
这正是默认情况下您将获得的(默认并发 =1)。
注意信息日志 Partitions assigned ...
。
我有这个方法
@KafkaListener(topics={"one", "two", "three"})
public void listen(String message) { ...}
监听器容器如何独立于主题和分区只实例化一个消费者。
例如,如果我有这些分区:
one-0
one-1
two-0
three-0
three-1
有没有办法将所有这些分区分配给同一个消费者?
ConcurrentKafkaListenerContainerFactory
的并发值 1 是否足以满足此目的?
这正是默认情况下您将获得的(默认并发 =1)。
注意信息日志 Partitions assigned ...
。