groupid 충돌 방지
This commit is contained in:
@@ -28,7 +28,8 @@ public class KafkaReceiverConfig {
|
||||
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
|
||||
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
|
||||
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
|
||||
props.put(ConsumerConfig.GROUP_ID_CONFIG, "orders");
|
||||
long seed = System.currentTimeMillis();
|
||||
props.put(ConsumerConfig.GROUP_ID_CONFIG, "orders"+seed);
|
||||
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
|
||||
props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user