-
Notifications
You must be signed in to change notification settings - Fork 116
Kafka update #3647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kafka update #3647
Conversation
|
When using a cluster, make sure that each alarm client receives all messages! Based on the cluster setup, messages could be spread across partitions. Each message would get to a consumer, but not all consumers get all messages. So clients would see only some of the alarm updates. To get all messages, the KafkaHelper creates each consumer with its own unique "group.id" .. but an update 3 years ago to add a kafka_properties preference, b7021d6, changed that into If you put several alarm clients in to the same "group.id", the alarm updates will be distributed across your alarm clients. With N alarm clients, each client will only see 1/Nth of the updates and then you wonder why each client shows a different alarm state. But yes, it will be more effective, because each alarm client only needs to handle 1/Nth of the messages. |
|
@kasemir, not sure I understand your comment... Are you saying that a |
|
See also first rule of clustering: Simply enabling "the cluster" is more likely to add problems than increase reliability. |
|
@kasemir, thanks for acting documentation. |
|
Yes, KafkaHelper defaults not only to a random but globally unique group.id. But it has only been tested with a single Kafka instance. If there's a cluster, I'm not sure that the unique group ID is all that we necessary to assert that all clients get all messages. So please check that, because Kafka does have operating modes to support the task idea where one client and only one client needs to handle a message. We don't want to accidentally end up in that mode. |
|
Yes, clusters can be a pain... I have managed to avoid them in the past but it turns out that a large number of facilities are using a 3 node kafka setup ( I believe nsls2 and eic are moving to the same setup) So...I think the key here is that based on our use case... we should ensure that each client gets a unique I would be fine with updating the kafka helper such that it would always set a globally unique group.id. If a group.id is specified in the the kafka.properties then there is a warning log message and it is ignored Additionally, I have added this compose file since it is what I have been using to test the alarm services with kafka 4 ( or 8 in the confluence versioning scheme ) |
ensure unique group.id remove the use of deprecated kafka streams interfaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates Kafka infrastructure and client code to support newer Kafka versions. It introduces a new Docker Compose configuration for a 3-node Kafka cluster and migrates from deprecated Kafka Streams API methods to their modern equivalents.
- Creates a new docker-compose file for deploying a 3-node Kafka cluster using KRaft mode
- Migrates Kafka Streams branching logic from deprecated
branch()API tosplit()API withBranchedconsumers - Simplifies consumer group ID generation by removing conditional logic
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| services/alarm-server/src/test/resources/docker/docker-compose-kafka-cluster.yml | New multi-node Kafka cluster configuration using KRaft mode with Confluent Platform 8.1.0 |
| services/alarm-logger/src/main/java/org/phoebus/alarm/logging/AlarmMessageLogger.java | Migrates from deprecated branch() to split() API, adds UUID import, removes TimeUnit import, refactors method signatures |
| app/alarm/model/src/main/java/org/phoebus/applications/alarm/client/KafkaHelper.java | Simplifies consumer group ID logic by always generating unique UUIDs instead of conditional checking |
| .gitignore | Adds broader *.pyc pattern to ignore Python compiled files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
services/alarm-logger/src/main/java/org/phoebus/alarm/logging/AlarmMessageLogger.java
Outdated
Show resolved
Hide resolved
…AlarmMessageLogger.java Co-authored-by: Copilot <[email protected]>

Create a new compose file to deploy a kafka 4 cluster
Checklist
Testing:
Documentation: