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

Unable to access AMQP Channel from RabbitListenerErrorHandler in case of MessageConversionException #2652

Closed
cryy opened this issue Mar 13, 2024 · 1 comment

Comments

@cryy
Copy link

cryy commented Mar 13, 2024

In what version(s) of Spring AMQP are you seeing this issue?

3.1.2

Describe the bug

Whenever a MessageConversionException occurs, the raw Spring message returned in RabbitListenerErrorHandler#handleError is null. Channel information is being stored inside of that raw message as per #1013.

This presents a problem for manual ack mode, as the channel information information is lost and you cannot manually ack the message, leaving it stuck in the queue. Is there any particular reason why the channel is not forwarded through the error handler arguments?

To Reproduce

Call any method that sends messages and converts objects via RabbitTemplate and attempt to convert an unsupported object.

Expected behavior

The error handler should return the Channel object whenever a message had been published.

Sample

N/A

@artembilan
Copy link
Member

OK. I think I'll change the contract of the RabbitListenerErrorHandler to accept a Channel as separate argument.
It is always available even we we have just failed to convert a message.

It is going to be in several cycles since we cannot just make a breaking change.
So, first of all we deprecate an existing method and introduce a new one as default.
In the next 3.2 version we will address it respectively.

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants