Commit 0c82698a authored by 张森's avatar 张森

kafka消息不重复消费问题处理

parent 256e3bfb
...@@ -249,7 +249,7 @@ public class KafkaConsumerService { ...@@ -249,7 +249,7 @@ public class KafkaConsumerService {
* *
* @param message 消息 * @param message 消息
*/ */
@KafkaListener(id = "consumerSingle", topics = "#{'${kafka.topics}'.split(',')}", concurrency = "2") @KafkaListener(id = "consumerSingle", groupId = "${kafka.station.groupId}", topics = "#{'${kafka.topics}'.split(',')}", concurrency = "2")
public void consumerSingle(String message, Acknowledgment ack) { public void consumerSingle(String message, Acknowledgment ack) {
JSONObject messageObj = JSONObject.fromObject(message); JSONObject messageObj = JSONObject.fromObject(message);
try { try {
......
...@@ -114,3 +114,5 @@ kafka.auto-startup=false ...@@ -114,3 +114,5 @@ kafka.auto-startup=false
#浜嬩欢鍛婅瀵规帴Kafka涓婚 #浜嬩欢鍛婅瀵规帴Kafka涓婚
queue.kafka.eventAlarm.topics=JKXT2BP-GJ-Topic-site queue.kafka.eventAlarm.topics=JKXT2BP-GJ-Topic-site
kafka.station.groupId=shaoxing
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment