GH-2461: RabbitListenerErrorHandler with Async

Resolves https://github.com/spring-projects/spring-amqp/issues/2461
This commit is contained in:
Gary Russell
2023-05-25 13:12:19 -04:00
committed by GitHub
parent e452af157e
commit e492b98bf8
5 changed files with 28 additions and 8 deletions

View File

@@ -3664,6 +3664,9 @@ Starting with version 3.0.5, the `@RabbitListener` (and `@RabbitHandler`) method
All the mentioned rules about `AcknowledgeMode.MANUAL` are still apply.
The `org.jetbrains.kotlinx:kotlinx-coroutines-reactor` dependency must be present in classpath to allow `suspend` function invocations.
Also starting with version 3.0.5, if a `RabbitListenerErrorHandler` is configured on a listener with an async return type (including Kotlin suspend functions), the error handler is invoked after a failure.
See <<annotation-error-handling>> for more information about this error handler and its purpose.
[[threading]]
===== Threading and Asynchronous Consumers

View File

@@ -48,9 +48,12 @@ See <<Jackson2JsonMessageConverter-from-message>> for more information
You can now configure a `ReplyPostProcessor` via the container factory rather than via a property on `@RabbitListener`.
See <<async-annotation-driven-reply>> for more information.
The `@RabbitListener` (and `@RabbitHandler`) methods can now be as a Kotlin `suspend` functions.
The `@RabbitListener` (and `@RabbitHandler`) methods can now be declared as Kotlin `suspend` functions.
See <<async-returns>> for more information.
Starting with version 3.0.5, listeners with async return types (including Kotlin suspend functions) invoke the `RabbitListenerErrorHandler` (if configured) after a failure.
Previously, the error handler was only invoked with synchronous invocations.
==== Connection Factory Changes
The default `addressShuffleMode` in `AbstractConnectionFactory` is now `RANDOM`.