Skip to content

Add Kafka messaging support#389

Merged
hluk merged 1 commit into
release-engineering:masterfrom
hluk:kafka
May 27, 2026
Merged

Add Kafka messaging support#389
hluk merged 1 commit into
release-engineering:masterfrom
hluk:kafka

Conversation

@hluk
Copy link
Copy Markdown
Member

@hluk hluk commented Apr 29, 2026

Introduce confluent-kafka publisher and unify all message publishers
(kafka, stomp, fedmsg) behind a consistent app.publisher interface.

JIRA: RHELWF-13773

Assisted-by: Claude Opus 4.6 noreply@anthropic.com

@hluk hluk force-pushed the kafka branch 2 times, most recently from bc72c6a to cd19c71 Compare April 29, 2026 11:47
@hluk hluk requested a review from mvalik April 29, 2026 15:12
Comment thread waiverdb/messaging/kafka.py Outdated
KafkaException: If there's an error sending the message to Kafka.
"""
config, producer_config = _parse_config()
producer = Producer(producer_config)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to use some existing instance of Producer instead of create a new one for each message.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've refactored the code - split the various message producers into sub-modules and added initialization code for (app.publisher = ...) with simpler message publishing code.

Comment thread waiverdb/messaging/kafka.py Outdated
@hluk hluk requested a review from mvalik May 11, 2026 11:22
Comment thread waiverdb/messaging/kafka.py Outdated
producer_config = dict(config.producer)
username = os.environ.get("WAIVERDB_KAFKA_SASL_USERNAME")
password = os.environ.get("WAIVERDB_KAFKA_SASL_PASSWORD")
if username:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both credentials should be present or both should be considered missing if at least one is missing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment thread waiverdb/messaging/kafka.py Outdated
)

try:
config = KafkaConfig(**config_dict)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shadowing the original variable config

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Introduce confluent-kafka publisher and unify all message publishers
(kafka, stomp, fedmsg) behind a consistent app.publisher interface.

Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
@hluk hluk merged commit aad2258 into release-engineering:master May 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants