Skip to content
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

fix(example): check if msg channel is closed #2479

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

ioanzicu
Copy link

No description provided.

Signed-off-by: Ioan Zicu <ioan.zicu@nokia.com>
@dnwe dnwe removed the cla-needed label Jul 12, 2023
@dnwe dnwe force-pushed the validate-received-message branch from 162de5f to 303de59 Compare July 28, 2023 08:19
@ioanzicu ioanzicu changed the title Conumer group example: check if received message is valid Consumer group example: check if received message is valid Jul 28, 2023
@ioanzicu ioanzicu force-pushed the validate-received-message branch from 303de59 to ce9475f Compare July 28, 2023 08:32
@dnwe
Copy link
Collaborator

dnwe commented Jul 29, 2023

@ioanzicu as per https://github.com/IBM/sarama/wiki/Frequently-Asked-Questions#why-am-i-getting-a-nil-message-from-the-sarama-consumer it should only be the case that you receive nil if the channel has been closed due to some error in the consumer

So we probably want to update the example from:

case message := <-claim.Messages():

to

case message, ok := <-claim.Messages():
if !ok { … }

pattern

@ioanzicu ioanzicu force-pushed the validate-received-message branch from 4f56485 to bb8803d Compare July 31, 2023 08:03
@ioanzicu
Copy link
Author

Looks like I have to fix this MR :)

@dnwe dnwe force-pushed the validate-received-message branch from bb8803d to 3e451b7 Compare August 3, 2023 12:26
@dnwe dnwe changed the title Consumer group example: check if received message is valid fix(example): check if msg channel is closed Aug 3, 2023
@dnwe
Copy link
Collaborator

dnwe commented Aug 3, 2023

No worries, I've rebased your branch for you and the checks are running now

@dnwe dnwe force-pushed the validate-received-message branch from 3e451b7 to ef6ac69 Compare August 3, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants