Skip to content

Commit b3be1c0

Browse files
committed
override any group.id with a globally unique one to ensure reliable behvaiour
1 parent 9916947 commit b3be1c0

File tree

1 file changed

+6
-8
lines changed
  • app/alarm/model/src/main/java/org/phoebus/applications/alarm/client

1 file changed

+6
-8
lines changed

app/alarm/model/src/main/java/org/phoebus/applications/alarm/client/KafkaHelper.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,12 @@ public static Consumer<String, String> connectConsumer(final String kafka_server
6363
Properties kafka_props = loadPropsFromFile(properties_file);
6464
kafka_props.put("bootstrap.servers", kafka_servers);
6565

66-
if (!kafka_props.containsKey("group.id")){
67-
// API requires for Consumer to be in a group.
68-
// Each alarm client must receive all updates,
69-
// cannot balance updates across a group
70-
// --> Use unique group for each client
71-
final String group_id = "Alarm-" + UUID.randomUUID();
72-
kafka_props.put("group.id", group_id);
73-
}
66+
// API requires for Consumer to be in a group.
67+
// Each alarm client must receive all updates,
68+
// cannot balance updates across a group
69+
// --> Use unique group for each client
70+
final String group_id = "Alarm-" + UUID.randomUUID();
71+
kafka_props.put("group.id", group_id);
7472

7573
logger.fine(kafka_props.getProperty("group.id") + " subscribes to " + kafka_servers + " for " + topics);
7674

0 commit comments

Comments
 (0)