Conversation
* Fix `MethodAmqpListenerEndpoint` for a proper `.listenerContainer` suffix. We really register an `AmqpMessageListenerContainer` instance
cppwfs
left a comment
There was a problem hiding this comment.
Docs and changes look good.
Just a couple of notes.
|
|
||
| * The `org.apache.qpid.protonj2.client.Client` where its `org.apache.qpid.protonj2.client.ClientOptions` property is based on the respective attributes of the imported metadata from the `@EnableAmqp`. | ||
| * The `AmqpListenerEndpointRegistry` - the global component to register AMQP listener containers programmatically. | ||
| * The `AmqpListenerAnnotationBeanPostProcessor` - a `BeanPostProcessor` to parse POJO methods with the `@AmqpListener` and register listener containers with via the `AmqpListenerEndpointRegistry`. |
There was a problem hiding this comment.
containers with via replace with containers via
|
|
||
| === `@AmqpListener` | ||
|
|
||
| For high-level and convenient configuration, the framework provides an `@AmqpListener` annotation to mark POJO methods to be used as listener invokers from created by the framework `AmqpMessageListenerContainer` instances. |
There was a problem hiding this comment.
Replace invokers from created by with invoker created by
| The `id` attribute is not required, and target listener container bean name will be based on the class name, method name plus `.listenerContainer` suffix. | ||
| The `addresses` - can be an array of names, or each item can be a comma-delimited set of names. | ||
| This can be useful when a list of AMQP addresses is provided via external configuration properties. | ||
| The `containerFactory` (see below), `executor`, `messageConverter` and `headerMapper` attributes are options and can be configured to bean name of bean reference as a SpEL expression like the `executor` in the sample above. |
There was a problem hiding this comment.
"are options and can be configured to bean name of bean reference". Did you mean "are optional and can be configured to a bean name or a bean reference".
| Unlike with the `@RabbitListener` and `RabbitListenerEndpointRegistry` infrastructure, the `AmqpListenerEndpointRegistry` uses an `AmqpMessageListenerContainerFactory` & `AmqpListenerEndpoint` to created an `AmqpMessageListenerContainer` instance, and registers it as a singleton bean into the application context directly. | ||
| The bean name for this `AmqpMessageListenerContainer` instance is a value from the `AmqpListenerEndpoint.getId()` or generated one based on the `MessageListener` class name and `.listenerContainer` suffix. | ||
|
|
||
| See `AmqpListenerEndpoint`, `AmqpMessageListenerContainerFactory` and `AmqpListenerEndpointRegistry` Javadocs for more information. No newline at end of file |
There was a problem hiding this comment.
I'm not sure what you mean here since GH does not complain that we don't have an end of file: https://imgur.com/a/GnmOU8q
This article discuss it in more details: https://www.reddit.com/r/learnprogramming/comments/t7qofi/why_does_github_care_if_a_file_doesnt_have_a/.
I think the problem is more about new line symbol (line break) in the end of current last line, but really not a new line: https://www.pcmag.com/encyclopedia/term/line-break.
The easiest way for us to put it there is to press Enter key, and that creates a new blank line indeed 😄
| The framework relies on a bean for this factory when `@AmqpListener` annotation is parsed via `AmqpListenerAnnotationBeanPostProcessor`. | ||
| If `@AmqpListener(containerFactory)` attribute is not provided on a POJO method, the framework expects a global bean for an `AmqpMessageListenerContainerFactory` with the `AmqpDefaultConfiguration.DEFAULT_AMQP_LISTENER_CONTAINER_FACTORY_BEAN_NAME`. | ||
|
|
||
| Unlike with the `@RabbitListener` and `RabbitListenerEndpointRegistry` infrastructure, the `AmqpListenerEndpointRegistry` uses an `AmqpMessageListenerContainerFactory` & `AmqpListenerEndpoint` to created an `AmqpMessageListenerContainer` instance, and registers it as a singleton bean into the application context directly. |
There was a problem hiding this comment.
to created an AmqpMessageListenerContainer instance should be to create an AmqpMessageListenerContainer instance
MethodAmqpListenerEndpointfor a proper.listenerContainersuffix. We really register anAmqpMessageListenerContainerinstance