Skip to content

Introduce @EnableAmqp#3288

Merged
cppwfs merged 3 commits intospring-projects:mainfrom
artembilan:EnableAmqp
Jan 14, 2026
Merged

Introduce @EnableAmqp#3288
cppwfs merged 3 commits intospring-projects:mainfrom
artembilan:EnableAmqp

Conversation

@artembilan
Copy link
Copy Markdown
Member

  • Import an AmqpDefaultConfiguration from the @EnableAmqp with convenient infrastructure beans
  • Make a default Client bean based on the ClientOptions built from the @EnableAmqp attributes
  • Mark AmqpDefaultConfiguration.protonClient() bean as @Conditional and skip its registration when any Client bean is already present in the target project configuration
  • Make Client injection into the SingleAmqpConnectionFactory as optional, and resolve single Client from the BeanFactory on demand internally
  • Change AmqpClientTests and AmqpMessageListenerContainerTests configurations to rely this or other way on the @EnableAmqp
  • Document the @EnableAmqp feature

@artembilan artembilan added this to the 4.1.0-M1 milestone Jan 14, 2026
@artembilan artembilan requested a review from cppwfs January 14, 2026 18:47
* Import an `AmqpDefaultConfiguration` from the `@EnableAmqp`
with convenient infrastructure beans
* Make a default `Client` bean based on the `ClientOptions` built
from the `@EnableAmqp` attributes
* Mark `AmqpDefaultConfiguration.protonClient()` bean as `@Conditional`
and skip its registration when any `Client` bean is already present
in the target project configuration
* Make `Client` injection into the `SingleAmqpConnectionFactory`
as optional, and resolve single `Client` from the `BeanFactory` on demand internally
* Change `AmqpClientTests` and `AmqpMessageListenerContainerTests`
configurations to rely this or other way on the `@EnableAmqp`
* Document the `@EnableAmqp` feature
* Add `AmqpClientTests.protonClientNotFromEnableAmqp()`
to verify that `AmqpDefaultConfiguration.OnMissingClientBeanCondition` works
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.

Great addition!

Just my usual annoying comments.

@artembilan
Copy link
Copy Markdown
Member Author

Just my usual annoying comments.

Stop it, please! 😸
They are very useful.
I'm glad to work with you so close that my work is getting better because of your comments and questions.
The quality of the final product should be beyond reach of any bugs 😉

* Remove redundant ctor for the `AmqpDefaultConfiguration.OnMissingClientBeanCondition`
* Rework a bit confusing sentences in the docs
@artembilan artembilan requested a review from cppwfs January 14, 2026 22:41
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.

LGTM

Thanks for the fixes and the great new feature!

@cppwfs cppwfs merged commit a47fb8b into spring-projects:main Jan 14, 2026
3 checks passed
@artembilan
Copy link
Copy Markdown
Member Author

Thank you for quick turnaround!

I wanted to give this for you to review as quickly as possible and with some simpler scope.
The next step will ‘@AmqpListener’ evolution for this infra.

@cppwfs
Copy link
Copy Markdown
Contributor

cppwfs commented Jan 14, 2026

My pleasure!

And that sounds awesome!

@artembilan artembilan deleted the EnableAmqp branch January 15, 2026 15:54
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