GH-1339: Fix RLErrorHandler with Conversion Ex. (#1346)

Resolves https://github.com/spring-projects/spring-amqp/issues/1339

Error handler was not called for conversion exceptions, preventing
the application from returning some error to the caller for request/reply processing.

**cherry-pick to 2.2.x**
This commit is contained in:
Gary Russell
2021-06-07 16:05:14 -04:00
committed by GitHub
parent 3b8fc2a7c2
commit 96070f6720
4 changed files with 117 additions and 44 deletions

View File

@@ -3276,7 +3276,7 @@ static class TxServiceImpl implements TxService<Foo> {
@Override
@RabbitListener(...)
public String handle(Foo foo, String rk) {
public String handle(Thing thing, String rk) {
...
}
@@ -3359,6 +3359,10 @@ public Object handleError(Message amqpMessage, org.springframework.messaging.Mes
----
====
Starting with version 2.2.18, if a message conversion exception is thrown, the error handler will be called, with `null` in the `message` argument.
This allows the application to send some result to the caller, indicating that a badly-formed message was received.
Previously, such errors were thrown and handled by the container.
====== Container Management
Containers created for annotations are not registered with the application context.