Skip to content

Introduce AmqpListenerEndpoint infrastructure#3330

Merged
cppwfs merged 2 commits intospring-projects:mainfrom
artembilan:AmqpMessageListenerContainerFactory
Feb 11, 2026
Merged

Introduce AmqpListenerEndpoint infrastructure#3330
cppwfs merged 2 commits intospring-projects:mainfrom
artembilan:AmqpMessageListenerContainerFactory

Conversation

@artembilan
Copy link
Copy Markdown
Member

  • Add AmqpListenerEndpoint abstraction to connect MessageListener with AmqpMessageListenerContainer at runtime
  • Provide SimpleAmqpListenerEndpoint implementation for programmatic registration
  • Add AmqpMessageListenerContainerFactory for creating AmqpMessageListenerContainer at runtime
  • The AmqpListenerEndpointRegistration configuration container is for convenience when we would like to register several endpoints against same AmqpMessageListenerContainerFactory
  • Register infrastructure AmqpListenerEndpointRegistry bean which processes AmqpListenerEndpoint, uses AmqpMessageListenerContainerFactory, and registers AmqpMessageListenerContainer bean.
    The AmqpListenerEndpointRegistry bean depends (optionally) on the AmqpDefaultConfiguration.DEFAULT_AMQP_LISTENER_CONTAINER_FACTORY_BEAN_NAME bean provided in the target project configuration.
    If neither default, nor the specific for the AmqpListenerEndpointRegistration, then application context fails
  • Some optimization and properties order rearranging in the AmqpMessageListenerContainer

* Add `AmqpListenerEndpoint` abstraction to connect `MessageListener`
with `AmqpMessageListenerContainer` at runtime
* Provide `SimpleAmqpListenerEndpoint` implementation for programmatic registration
* Add `AmqpMessageListenerContainerFactory` for creating `AmqpMessageListenerContainer` at runtime
* The `AmqpListenerEndpointRegistration` configuration container is for convenience
when we would like to register several endpoints against same `AmqpMessageListenerContainerFactory`
* Register infrastructure `AmqpListenerEndpointRegistry` bean which processes
`AmqpListenerEndpoint`, uses `AmqpMessageListenerContainerFactory`, and
registers `AmqpMessageListenerContainer` bean.
The `AmqpListenerEndpointRegistry` bean depends (optionally)
on the `AmqpDefaultConfiguration.DEFAULT_AMQP_LISTENER_CONTAINER_FACTORY_BEAN_NAME` bean
provided in the target project configuration.
If neither default, nor the specific for the `AmqpListenerEndpointRegistration`, then application context fails
* Some optimization and properties order rearranging in the `AmqpMessageListenerContainer`
@artembilan artembilan added this to the 4.1.0-M2 milestone Feb 9, 2026
@artembilan artembilan requested a review from cppwfs February 9, 2026 22:54
@artembilan
Copy link
Copy Markdown
Member Author

With this infra I'm very close to the @AmqpListener 😄 .

There are no docs for this stuff yet since it might be changed moving forward this or other way.

Giving you this as the next step before real annotation hardcore.
It would be much complicated trying to go from up to down.

Thanks

Copy link
Copy Markdown
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome stuff!
Great work, just a couple of comments.


/**
* The configuration model to represent a {@link MessageListener}
* with properties for target @{@link org.springframework.amqp.client.listener.AmqpMessageListenerContainer}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ is outside of {@link org.springframework.amqp.client.listener.AmqpMessageListenerContainer}

* Add Javadocs for `AmqpListenerEndpointRegistry` methods
* Use `Executor` as a property for `AmqpMessageListenerContainerFactory` API
* Fix Javadoc in the `AmqpMessageListenerContainerFactory`
* Fix bean name generation logic in the `AmqpListenerEndpointRegistry`
@artembilan artembilan requested a review from cppwfs February 10, 2026 21:32
@cppwfs cppwfs merged commit d7eae56 into spring-projects:main Feb 11, 2026
3 checks passed
@artembilan artembilan deleted the AmqpMessageListenerContainerFactory branch February 25, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants