Skip to content

Conversation

@eddumelendez
Copy link
Contributor

@eddumelendez eddumelendez commented Jul 31, 2025

  • Add support for RabbitMQ AMQP 1.0
  • Add smoke test for RabbitMQ AMQP 1.0

@eddumelendez eddumelendez changed the title rabbitmq amqp Add support for Rabbitmq AMQP 1.0 Jul 31, 2025
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 31, 2025
Signed-off-by: Eddú Meléndez <[email protected]>
@eddumelendez eddumelendez changed the title Add support for Rabbitmq AMQP 1.0 Add support for RabbitMQ AMQP 1.0 Jul 31, 2025
* @author Eddú Meléndez
* @since 4.0.0
*/
@AutoConfiguration
Copy link
Member

Choose a reason for hiding this comment

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

I think need to make before = RabbitAutoConfiguration.class and make that one conditional on something missing from this RabbitAmqpAutoConfiguration.
This is an addition to my previous point: the AMQP 1.0 is by default.
If we don't make them conditional on each other, then both protocols are going to be enabled and connected.
Especially, I worry about RabbitAmqpAdmin and RabbitAdmin which are going to handle topology in parallel but in different connections.
I don't think that we need to give a choice to be able to have both protocols in one Spring Boot application.


private final RabbitProperties properties;

RabbitAmqpAutoConfiguration(RabbitProperties properties) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to look into a separate RabbitAmqpProperties abstraction.
Even if some duplication is possible, a bunch of existing properties are not going to be used for AMQP 1.0 at all.
And might cause confusion.

Signed-off-by: Eddú Meléndez <[email protected]>
Signed-off-by: Eddú Meléndez <[email protected]>
Signed-off-by: Eddú Meléndez <[email protected]>
Signed-off-by: Eddú Meléndez <[email protected]>
Signed-off-by: Eddú Meléndez <[email protected]>
Signed-off-by: Eddú Meléndez <[email protected]>
@AutoConfiguration
@ConditionalOnClass({ RabbitTemplate.class, Channel.class })
@ConditionalOnMissingClass({ "com.rabbitmq.client.amqp.Connection",
"org.springframework.amqp.rabbitmq.client.RabbitAmqpTemplate" })
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is correct.
We may still have those classes on classpath, but opt-in to use AMQP 0.9.1.
For example, via auto-configuration exclusion for that our new RabbitAmqpAutoConfiguration.
Why not conditional on bean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to conditional on missing bean

Signed-off-by: Eddú Meléndez <[email protected]>
@eddumelendez eddumelendez force-pushed the rabbitmq-amqp branch 2 times, most recently from 05bec25 to 2be167a Compare August 12, 2025 18:21
Signed-off-by: Eddú Meléndez <[email protected]>
Signed-off-by: Eddú Meléndez <[email protected]>
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

LGTM.

Might be some docs also required, but so far this is great.

Thank you!

@bclozel bclozel added the for: team-meeting An issue we'd like to discuss as a team to make progress label Oct 9, 2025
@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Oct 16, 2025
@philwebb philwebb added this to the 4.x milestone Oct 16, 2025
@snicoll snicoll self-assigned this Nov 17, 2025
@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Nov 19, 2025
@snicoll
Copy link
Member

snicoll commented Nov 19, 2025

@artembilan and I brainstormed a bit and things should be in a different state than what's been discussed thus far:

  • It feels that AMQP 0.9 and AMQP 1.0 support should live in separate modules. The reason for the separate module is that it should be possible to connect to RabbitMQ with both protocols. Having to add an explicit module is a strong enough signal to do so (vs. the situation in this PR).
  • AMQP 0.9 is due for deprecation at some point so it'd be easier to handle that if the code is in a separate module.
  • At this time, Spring AMQP has only support for RabbitMQ with AMQP 1.0. spring-boot-rabbitmq could be a potential name for the new API. Spring AMQP will add support for "generic" AMQP support with 1.0 though.

Things are a bit blurry at this point given that we can merge this in SB 4.1 at the earliest. By then, Spring AMQP may have support for other brokers so that suggested name above wouldn't work.

I've flagged this for team meeting to see what the team thinks. If we want to go with two separate modules, then we might rename the current one spring-amqp-classic and have the existing spring-boot-amqp module with the 1.0 support. We've used the classic term quite a bit in the past but I am not sure if that matches the community usage of AMQP 0.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for: team-attention An issue we'd like other members of the team to review type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants