Skip to content

GH-10163: Fallback to default errorChannel in RabbitStreamMessageHandler #10184

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

Merged
merged 3 commits into from
Jul 2, 2025

Conversation

rrileyca
Copy link
Contributor

@rrileyca rrileyca commented Jul 2, 2025

Fixes: #10163

If RabbitStreamMessageHandler was used in async mode, error messages were dropped unless a sendFailureChannel or sendFailureChannelName were provided. This adds the "errorChannel" name as a fallback.

rrileyca added 2 commits July 1, 2025 19:22
Fixes: spring-projects#10163

If RabbitStreamMessageHandler was used in async mode, error messages were dropped unless a sendFailureChannel or sendFailureChannelName were provided. This adds the "errorChannel" name as a fallback.

Signed-off-by: rrileyca <[email protected]>
…running in async mode so that errors are not lost.

Signed-off-by: rrileyca <[email protected]>
@rrileyca
Copy link
Contributor Author

rrileyca commented Jul 2, 2025

@artembilan Third time is the charm. I hope I have cleaned up everything now up to Spring's standards!

@@ -543,7 +544,9 @@ void testConsumeAndProduceTransaction() throws Exception {
KafkaMessageDrivenChannelAdapter inbound = new KafkaMessageDrivenChannelAdapter<>(container);
DirectChannel channel = new DirectChannel();
inbound.setOutputChannel(channel);
DirectChannel sendFailureChannel = new DirectChannel();
Copy link
Member

Choose a reason for hiding this comment

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

Why do you introduce his variable if it is out of verification part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this because without it, the call to getChannelResolver() would throw an error because the beanFactory is null. Instead of creating a BeanFactory and a message channel, I thought it would be harmless to just create a channel and set it in order to circumvent the error.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see! So, we probably just can use new NullChannel() in that setter and no any extra local variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had forgotten about the NullChannel. Good idea. Fixed.

@artembilan
Copy link
Member

The PR looks really good .
Pay attention how PR description has matched from your first commit message .
Plus now with that Fixed: it will close issue on merge.

up to Spring's standards

it is not about standards, but reasoning and convenience for all of us. The code style is also for easy to read. So, yeah, we can call it “standard”, but that came after years of cooperation with the community and back & forth attempts . Therefore now we can even call it “the way” 😉

@rrileyca
Copy link
Contributor Author

rrileyca commented Jul 2, 2025

Therefore now we can even call it “the way” 😉

Thank you for showing me the way then! This was fun. I hope to contribute more in the future - this time, with clean PRs ;)

@artembilan artembilan merged commit f4670e5 into spring-projects:main Jul 2, 2025
3 checks passed
@artembilan
Copy link
Member

There is one more problem , @rrileyca :

Signed-off-by: rrileyca [email protected]

That has to be your legal name if you are OK with legal obligations according to DCO.
If you are not, then we cannot accept contributions from you.

I took a liberty to modify your final commit message on merge, but I hope you’ll fix you Git client to populate a proper name.

Thank you again !

@rrileyca
Copy link
Contributor Author

rrileyca commented Jul 2, 2025

I had made a non-global config in the previous repo, which I since deleted and recreated. Sorry about that. My legal name is Ryan Riley, as per the @author annotations.

Thank you!

@artembilan
Copy link
Member

I think I did it right: f4670e5

@rrileyca
Copy link
Contributor Author

rrileyca commented Jul 2, 2025

I think I did it right: f4670e5

You did!

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.

RabbitMQ Streams Client Errors Getting Lost
2 participants