Skip to content

Add Kafka listener - #511

Merged
mvalik merged 1 commit into
release-engineering:masterfrom
mvalik:vm_branch_kafka
Sep 25, 2026
Merged

mvalik merged 1 commit into
release-engineering:masterfrom
mvalik:vm_branch_kafka

Conversation

@mvalik

@mvalik mvalik commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

JIRA: RHELWF-13776

Assisted-by: Opus 4.6

@mvalik
mvalik requested a review from hluk September 23, 2026 10:30
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.10913% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.24%. Comparing base (bc8484c) to head (154ebc8).

Files with missing lines Patch % Lines
greenwave/listeners/base.py 97.91% 0 Missing and 2 partials ⚠️
greenwave/tests/test_listeners_kafka.py 99.29% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #511      +/-   ##
==========================================
+ Coverage   92.53%   93.24%   +0.71%     
==========================================
  Files          55       57       +2     
  Lines        4272     4711     +439     
  Branches      270      300      +30     
==========================================
+ Hits         3953     4393     +440     
+ Misses        264      260       -4     
- Partials       55       58       +3     
Flag Coverage Δ
unit-tests 93.24% <99.10%> (+0.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mvalik

mvalik commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@hluk if you find it good, feel free to immediately merge it, let's merge it ASAP.

@hluk hluk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you update message-broker in docker-compose.yml and configuration for waiverdb and resultsdb in compose env so it uses Kafka instead?

Comment thread greenwave/listeners/base.py Outdated
@mvalik

mvalik commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Can you update message-broker in docker-compose.yml and configuration for waiverdb and resultsdb in compose env so it uses Kafka instead?

Done

@mvalik
mvalik requested a review from hluk September 24, 2026 07:44
Comment thread docker-compose.yml Outdated
Comment thread greenwave/listeners/base.py Outdated
Comment thread greenwave/listeners/base.py Outdated
def _listen_kafka(self):
from greenwave.listeners.kafka import KafkaBus

with self.connection_condition:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The block is probably not needed here since the thread should not be running yet.

But it should have similar "Already connected" check as in _listen_stomp.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread greenwave/listeners/base.py Outdated
Comment thread greenwave/listeners/base.py Outdated
}
if self._backend == "kafka":
try:
self._kafka_bus.publish(self.destination, body, headers)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is also missing with self.connection_condition

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread greenwave/listeners/base.py Outdated
JIRA: RHELWF-13776

Assisted-by: Opus 4.6
@mvalik
mvalik requested a review from hluk September 24, 2026 23:26
@mvalik
mvalik merged commit 94b13ee into release-engineering:master Sep 25, 2026
11 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