Skip to content

Add support for RabbitMQ AMQP 1.0#46608

Closed
eddumelendez wants to merge 1 commit intospring-projects:mainfrom
eddumelendez:rabbitmq-amqp
Closed

Add support for RabbitMQ AMQP 1.0#46608
eddumelendez wants to merge 1 commit intospring-projects:mainfrom
eddumelendez:rabbitmq-amqp

Conversation

@eddumelendez
Copy link
Copy Markdown
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
@eddumelendez eddumelendez changed the title Add support for Rabbitmq AMQP 1.0 Add support for RabbitMQ AMQP 1.0 Jul 31, 2025
Comment thread module/spring-boot-amqp/build.gradle Outdated
* @author Eddú Meléndez
* @since 4.0.0
*/
@AutoConfiguration
Copy link
Copy Markdown
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
Copy Markdown
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.

@AutoConfiguration
@ConditionalOnClass({ RabbitTemplate.class, Channel.class })
@ConditionalOnMissingClass({ "com.rabbitmq.client.amqp.Connection",
"org.springframework.amqp.rabbitmq.client.RabbitAmqpTemplate" })
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread starter/spring-boot-starter-rabbitmq/build.gradle Outdated
@eddumelendez eddumelendez force-pushed the rabbitmq-amqp branch 3 times, most recently from 2be167a to b3b1d45 Compare August 12, 2025 18:24
Copy link
Copy Markdown
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
Copy Markdown
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.

@snicoll
Copy link
Copy Markdown
Member

snicoll commented Dec 12, 2025

@eddumelendez this is what the conclusion we came to in preparation for the next version of Spring AMQP:

  • Code from spring-boot-amqp(+ starters, etc) move as is to spring-boot-rabbitmq.
  • The existing spring-boot-amqp module can now be used to host the AMQP 1.0 implementation.

Auto-configuration of both a 0.9 client and a 1.0 client is possible if you add the two modules on the classpath (contrary to what's been discussed during the review).

Do you want to explore this option and amend your PR? If not, no worries and please let me know either way.

@eddumelendez
Copy link
Copy Markdown
Contributor Author

Thanks for sharing, @snicoll! I'll work on this changes

@snicoll snicoll removed the for: team-attention An issue we'd like other members of the team to review label Dec 26, 2025
@snicoll snicoll removed their assignment Jan 6, 2026
@snicoll
Copy link
Copy Markdown
Member

snicoll commented Jan 30, 2026

Heya @eddumelendez, any update for us? If you're still working on it, no worries. I just want to avoid adding a change like that in the RC.

@snicoll snicoll self-assigned this Jan 30, 2026
@eddumelendez
Copy link
Copy Markdown
Contributor Author

Hi @snicoll, yes, still working on it. Should have an update next week.

@eddumelendez
Copy link
Copy Markdown
Contributor Author

@snicoll Sorry for the delay. PR is updated.

@snicoll
Copy link
Copy Markdown
Member

snicoll commented Mar 3, 2026

Thanks @eddumelendez.

I've rebased and squashed all commits and I've started to look at this. Here are some questions:

  • RabbitProperties is copy/pasted between the two modules, which can't work because two types are contributing properties to the same namespace. Shouldn't it be AmqpProperties (spring.amqp)? Also I am not sure that all the existing keys are actually handled by 0.1.0. If they are then perhaps we're missing a common layer somewhere
  • RabbitConnectionDetails is also copy/pasted which doesn't look right to me.

My expectation is that things are quite separated with support for 1.0.0 having different concepts.

@eddumelendez
Copy link
Copy Markdown
Contributor Author

Hi @snicoll, I have polished the properties and renamed to namespace to spring.amqp. Also, drop the ssl properties for now.

@snicoll
Copy link
Copy Markdown
Member

snicoll commented Mar 19, 2026

Hi @eddumelendez, there's a bit of back and forth here but this where we're heading:

  • spring-boot-rabbitmq to host the existing support (AMQP 0.9): this is done and I've used part of this PR to validate consistent changes.
  • spring-boot-amqp to host the generic AMQP 1.0 support. This isn't part of this PR and is still work in progress
  • spring-boot-amqp-rabbitmq to host the RabbitMQ-specific AMQP 1.0 support. In your PR this is defined in the spring-boot-amqpmodule I believe.

Would you be willing to squash and rebase your contribution with only a spring-boot-amqp-rabbitmq module and updated doc? If so I can try to integrate that the same way I did for spring-boot-rabbitmq.

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

Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
@eddumelendez
Copy link
Copy Markdown
Contributor Author

Hi @snicoll, I've rebased and squash the changes. Thanks for building the foundation to support RabbitMQ AMQP 1.0

@snicoll
Copy link
Copy Markdown
Member

snicoll commented Mar 31, 2026

Thanks for the follow-up @eddumelendez - This commit has been incorporated in the feature branch I am working on so I am going to close this in favor of #49857

@snicoll snicoll closed this Mar 31, 2026
@snicoll snicoll removed this from the 4.x milestone Mar 31, 2026
@snicoll snicoll added the status: superseded An issue that has been superseded by another label Mar 31, 2026
@eddumelendez eddumelendez deleted the rabbitmq-amqp branch March 31, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: superseded An issue that has been superseded by another type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants