Skip to content

Commit fecd0ba

Browse files
garyrussellartembilan
authored andcommitted
AMQP-799: Default @RabbitHandler Docs
JIRA: https://jira.spring.io/browse/AMQP-799
1 parent ee61179 commit fecd0ba

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/reference/asciidoc/amqp.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,10 +2233,10 @@ This is best described using an example:
22332233
[source, java]
22342234
----
22352235
@RabbitListener(id="multi", queues = "someQueue")
2236+
@SendTo("my.reply.queue")
22362237
public class MultiListenerBean {
22372238
22382239
@RabbitHandler
2239-
@SendTo("my.reply.queue")
22402240
public String bar(Bar bar) {
22412241
...
22422242
}
@@ -2251,6 +2251,11 @@ public class MultiListenerBean {
22512251
...
22522252
}
22532253
2254+
@RabbitHandler(isDefault = true)
2255+
public String defaultMethod(Object object) {
2256+
...
2257+
}
2258+
22542259
}
22552260
----
22562261

@@ -2259,7 +2264,9 @@ It is important to understand that the system must be able to identify a unique
22592264
The type is checked for assignability to a single parameter that has no annotations, or is annotated with the `@Payload` annotation.
22602265
Notice that the same method signatures apply as discussed in the method-level `@RabbitListener` described above.
22612266

2262-
Notice that the `@SendTo` must be specified on each method (if needed); it is not supported at the class level.
2267+
Starting with _version 2.0.3_, a `@RabbitHandler` method can be designated as the default method which is invoked if there is no match on other methods.
2268+
At most one method can be so designated.
2269+
22632270

22642271
[[repeatable-rabbit-listener]]
22652272
====== @Repeatable @RabbitListener

src/reference/asciidoc/whats-new.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ You can now set the `autoStartup` property of the listener container at the anno
143143

144144
See <<async-annotation-driven>> for more information.
145145

146+
Starting with _version 2.0.3_, one of the `@RabbitHandler` s on a class-level `@RabbitListener` can be designated as the default.
147+
See <<annotation-method-selection>> for more information.
148+
146149
===== Container Conditional Rollback
147150

148151
When using an external transaction manager (e.g. JDBC), rule-based rollback is now supported when providing the container with a transaction attribute.

0 commit comments

Comments
 (0)