|
|
@@ -58,9 +58,10 @@ public class KafkaCloudConsumer {
|
|
|
//groupId
|
|
|
String groupId = "old-to-cloud-group";
|
|
|
String value = record.value();
|
|
|
+ int partition = record.partition();
|
|
|
|
|
|
//判断 offset
|
|
|
- Boolean canConsume = xfOffsetService.judgeCanConsume(topic, groupId, offset);
|
|
|
+ Boolean canConsume = xfOffsetService.judgeCanConsume(topic, groupId, offset, partition);
|
|
|
if(!canConsume){
|
|
|
log.info("[kafka消息处理]-[消息:{}-[已消费,不能重复消费,offset: {},topic:{},groupId:{},]", record.value(), offset,topic,groupId);
|
|
|
return;
|
|
|
@@ -92,9 +93,10 @@ public class KafkaCloudConsumer {
|
|
|
//groupId
|
|
|
String groupId = "local-to-cloud-group";
|
|
|
String value = record.value();
|
|
|
+ int partition = record.partition();
|
|
|
|
|
|
//判断 offset
|
|
|
- Boolean canConsume = xfOffsetService.judgeCanConsume(topic, groupId, offset);
|
|
|
+ Boolean canConsume = xfOffsetService.judgeCanConsume(topic, groupId, offset,partition);
|
|
|
if(!canConsume){
|
|
|
log.info("[kafka消息处理]-[消息:{}-[已消费,不能重复消费,offset: {},topic:{},groupId:{},]", record.value(), offset,topic,groupId);
|
|
|
return;
|