Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache kafka Spring Kafka消费者/听众组_Apache Kafka_Spring Kafka - Fatal编程技术网

Apache kafka Spring Kafka消费者/听众组

Apache kafka Spring Kafka消费者/听众组,apache-kafka,spring-kafka,Apache Kafka,Spring Kafka,在消费者处指定组有什么区别 spring.kafka.consumer.group-id vs在@KafkaListener处指定 @KafkaListener(topic="test", group = "test-grp") 查看javadocs了解组属性;它与卡夫卡group.id无关 /** * If provided, the listener container for this listener will be added to a bean * with this val

在消费者处指定组有什么区别

spring.kafka.consumer.group-id
vs在@KafkaListener处指定

@KafkaListener(topic="test", group = "test-grp")

查看javadocs了解
属性;它与卡夫卡
group.id
无关

/**
 * If provided, the listener container for this listener will be added to a bean
 * with this value as its name, of type {@code Collection<MessageListenerContainer>}.
 * This allows, for example, iteration over the collection to start/stop a subset
 * of containers.
 * @return the bean name for the group.
 */

以前,每个侦听器都需要一个容器工厂/消费者工厂;这些允许您使用一个factory实例并覆盖
组.id

谢谢@Gary Russel。我已经看过文件了,但不清楚。“以前,每个侦听器都需要一个容器工厂/使用者工厂;这允许您使用一个工厂实例并覆盖group.id。”这一澄清帮助了我。
/**
 * Override the {@code group.id} property for the consumer factory with this value
 * for this listener only.
 * @return the group id.
 * @since 1.3
 */
String groupId() default "";

/**
 * When {@link #groupId() groupId} is not provided, use the {@link #id() id} (if
 * provided) as the {@code group.id} property for the consumer. Set to false, to use
 * the {@code group.id} from the consumer factory.
 * @return false to disable.
 * @since 1.3
 */
boolean idIsGroup() default true;