@@ -89,6 +89,10 @@ public class KafkaSqlFactory {
89
89
"ssl.endpoint.identification.algorithm=" })
90
90
Properties consumerProperties ;
91
91
92
+ @ ConfigProperty (name = "apicurio.kafkasql.consumer.group-prefix" , defaultValue = "apicurio-" )
93
+ @ Info (category = "storage" , description = "Kafka sql storage prefix for consumer group name" )
94
+ String groupPrefix ;
95
+
92
96
@ Inject
93
97
@ RegistryProperties (value = { "apicurio.kafka.common" , "apicurio.kafkasql.admin" }, empties = {
94
98
"ssl.endpoint.identification.algorithm=" })
@@ -256,8 +260,10 @@ public ProducerActions<KafkaSqlMessageKey, KafkaSqlMessage> createKafkaJournalPr
256
260
public KafkaConsumer <KafkaSqlMessageKey , KafkaSqlMessage > createKafkaJournalConsumer () {
257
261
Properties props = (Properties ) consumerProperties .clone ();
258
262
263
+ String consumerGroupId = groupPrefix + UUID .randomUUID ().toString ();
264
+
259
265
props .putIfAbsent (ProducerConfig .BOOTSTRAP_SERVERS_CONFIG , bootstrapServers );
260
- props .putIfAbsent (ConsumerConfig .GROUP_ID_CONFIG , UUID . randomUUID (). toString () );
266
+ props .putIfAbsent (ConsumerConfig .GROUP_ID_CONFIG , consumerGroupId );
261
267
props .putIfAbsent (ConsumerConfig .ENABLE_AUTO_COMMIT_CONFIG , "true" );
262
268
props .putIfAbsent (ConsumerConfig .AUTO_COMMIT_INTERVAL_MS_CONFIG , "1000" );
263
269
props .putIfAbsent (ConsumerConfig .AUTO_OFFSET_RESET_CONFIG , "earliest" );
@@ -305,8 +311,10 @@ public ProducerActions<String, String> createKafkaSnapshotsProducer() {
305
311
public KafkaConsumer <String , String > createKafkaSnapshotsConsumer () {
306
312
Properties props = (Properties ) consumerProperties .clone ();
307
313
314
+ String consumerGroupId = groupPrefix + UUID .randomUUID ().toString ();
315
+
308
316
props .putIfAbsent (ProducerConfig .BOOTSTRAP_SERVERS_CONFIG , bootstrapServers );
309
- props .putIfAbsent (ConsumerConfig .GROUP_ID_CONFIG , UUID . randomUUID (). toString () );
317
+ props .putIfAbsent (ConsumerConfig .GROUP_ID_CONFIG , consumerGroupId );
310
318
props .putIfAbsent (ConsumerConfig .ENABLE_AUTO_COMMIT_CONFIG , "true" );
311
319
props .putIfAbsent (ConsumerConfig .AUTO_COMMIT_INTERVAL_MS_CONFIG , "1000" );
312
320
props .putIfAbsent (ConsumerConfig .AUTO_OFFSET_RESET_CONFIG , "earliest" );
0 commit comments