我的消费者组陷入了重新平衡,并且不使用v0.11 kafka

时间:2019-07-24 16:32:33

标签: apache-kafka kafka-consumer-api spring-kafka

我的消费者组没有使用kafka集群v 0.11中的主题数据

它启动,并且不处理该主题的消息。我看到以下日志:

Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.222 Level=INFO 47637 --- [ntainer#0-9-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.222 Level=INFO 47637 --- [ntainer#0-2-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.222 Level=INFO 47637 --- [ntainer#0-5-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.222 Level=INFO 47637 --- [ntainer#0-7-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.227 Level=INFO 47637 --- [ntainer#0-7-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.227 Level=INFO 47637 --- [ntainer#0-5-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.227 Level=INFO 47637 --- [ntainer#0-3-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.227 Level=INFO 47637 --- [ntainer#0-9-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.227 Level=INFO 47637 --- [ntainer#0-2-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-3-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-5-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-7-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-9-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-2-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-7-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-5-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-9-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-3-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.228 Level=INFO 47637 --- [ntainer#0-2-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.233 Level=INFO 47637 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.234 Level=INFO 47637 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.234 Level=INFO 47637 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.234 Level=INFO 47637 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.269 Level=INFO 47637 --- [ntainer#0-6-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.270 Level=INFO 47637 --- [ntainer#0-6-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.270 Level=INFO 47637 --- [ntainer#0-6-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.270 Level=INFO 47637 --- [ntainer#0-6-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.396 Level=INFO 47637 --- [ntainer#0-1-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.397 Level=INFO 47637 --- [ntainer#0-1-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.398 Level=INFO 47637 --- [ntainer#0-1-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.398 Level=INFO 47637 --- [ntainer#0-1-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.521 Level=INFO 47637 --- [ntainer#0-4-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.522 Level=INFO 47637 --- [ntainer#0-4-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.522 Level=INFO 47637 --- [ntainer#0-4-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.522 Level=INFO 47637 --- [ntainer#0-4-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.522 Level=INFO 47637 --- [ntainer#0-8-C-1] o.a.k.c.c.internals.AbstractCoordinator  : Discovered coordinator xxxx:9097 (id: 2147477640 rack: null) for group cs-ms-mapping-processor-dev-new.
2019-07-24 11:25:08.523 Level=INFO 47637 --- [ntainer#0-8-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : Revoking previously assigned partitions [] for group cs-ms-mapping-processor-dev-new
2019-07-24 11:25:08.523 Level=INFO 47637 --- [ntainer#0-8-C-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]
2019-07-24 11:25:08.524 Level=INFO 47637 --- [ntainer#0-8-C-1] o.a.k.c.c.internals.AbstractCoordinator  : (Re-)joining group cs-ms-mapping-processor-dev-new


I also see this log:
Auto-commit of offsets {cs-ms-notification-prod-6=OffsetAndMetadata{offset=401005946, metadata=''}} failed for group cs-ms-mapping-processor-prod-new: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records
max-poll-records: 1
session.timeout.ms: "450000"
request.timeout.ms: "480000"
max.poll.interval.ms: "450000"

代码段

@KafkaListener(topics = "${kafka.notification.topic-name:notification}", containerFactory = NOTIFICATION_LISTENER_CONTAINER_FACTORY)
    public void accept(KafkaStatusMessage kafkaStatusMessage) {
        ContentId contentId = kafkaStatusMessage.getHeaders();
        StatusInfo statusInfo = kafkaStatusMessage.getCurrentStatus();
        List<StatusInfo> previousStatuses = kafkaStatusMessage.getPreviousStatuses();
}

DefaultKafkaConsumerFactory<String, KafkaStatusMessage> consumerFactory = new DefaultKafkaConsumerFactory<>(
                kafkaProperties.buildConsumerProperties(),
                new StringDeserializer(),
                jsonDeserializer);

这是我现在拥有的配置值

我希望它使用主题中的消息,但不这样做

0 个答案:

没有答案