Skip to content

Commit 6da994a

Browse files
committed
GH-2895: Mention endpoint.setId() in the registration.adoc
Fixes: #2895 Since `id` is required for the `SimpleRabbitListenerEndpoint` definition, it is better to show it in the docs sample and mention its importance.
1 parent b6e7235 commit 6da994a

File tree

1 file changed

+3
-0
lines changed
  • src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven

1 file changed

+3
-0
lines changed

src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/registration.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class AppConfig implements RabbitListenerConfigurer {
1414
@Override
1515
public void configureRabbitListeners(RabbitListenerEndpointRegistrar registrar) {
1616
SimpleRabbitListenerEndpoint endpoint = new SimpleRabbitListenerEndpoint();
17+
endpoint.setId("someRabbitListenerEndpoint");
1718
endpoint.setQueueNames("anotherQueue");
1819
endpoint.setMessageListener(message -> {
1920
// processing
@@ -25,5 +26,7 @@ public class AppConfig implements RabbitListenerConfigurer {
2526

2627
In the preceding example, we used `SimpleRabbitListenerEndpoint`, which provides the actual `MessageListener` to invoke, but you could just as well build your own endpoint variant to describe a custom invocation mechanism.
2728

29+
NOTE: the `id` property is required for `SimpleRabbitListenerEndpoint` definition.
30+
2831
It should be noted that you could just as well skip the use of `@RabbitListener` altogether and register your endpoints programmatically through `RabbitListenerConfigurer`.
2932

0 commit comments

Comments
 (0)