报错(已解决):Offset commit failed on partition xxx at offset 296: The coordinator is not aware of this me

博客讲述了在使用Scala操作Kafka时遇到的Offset commit失败问题,特别是针对partition xxx在offset 296处的错误。通过调整subscribe方法指定偏移量,最终成功解决了问题。
摘要由CSDN通过智能技术生成

1.忘了截图了。也没有办法还原,反正最后成功了,

1:)换个 group id  就可以。 scala 代码开发方式
   (2:)scala  解决办法
    public static final String GROUP_ID_CONFIG = "group.id";
    private static final String GROUP_ID_DOC = "A unique string that identifies the consumer group this consumer belongs to. This property is required if the consumer uses either the group management functionality by using <code>subscribe(topic)</code> or the Kafka-based offset management strategy.";

中的 subscribe 方法指定偏移量

(3)java  方法  感谢大佬 jannals   原博客网址  https://4m.cn/JcFj1  我缩短了下
1. 使用不同的组名,并且通过 consumer.assign
  
  
@Test
public void testModifyOffsetForReConsumer() {
   
    Properties props = new Properties();
    props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 10
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值