Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility between RabbitProperties from Spring Boot 3.4.0 and CachingConnectionFactory #2917

Closed
oneiros-de opened this issue Dec 3, 2024 · 1 comment

Comments

@oneiros-de
Copy link

In what version(s) of Spring AMQP are you seeing this issue?

3.2.0

Describe the bug

In Spring Boot 3.4.0 org.springframework.boot.autoconfigure.amqp.RabbitProperties#getAddresses() returns a List<String> while it previously returned a String.

This makes it incompatible with AbstractConnectionFactory.setAddresses which accepts a String.

With Spring Boot 3.3x and AMQP 3.2.0 one can write cachingConnectionFactory.setAddresses(rabbitProperties.getAddresses()); which is impossible with 3.4.0

Expected behavior

Either make setAddresses compatible with the new RabbitProperties or add a new method that is.

@artembilan
Copy link
Member

Not sure why would one use Spring Boot, but not its auto-configuration.
I mean that CachingConnectionFactory bean is really created by the RabbitAutoConfiguration, so no need to deal with your own custom beans.

As a workaround I see that it is easy to adjust your code:

cachingConnectionFactory.setAddresses(rabbitProperties.getAddresses().stream().collect(Collectors.joining(",")));

Either way, I'll introduce AbstractConnectionFactory.setAddresses(List<String> addresses) shortly.

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

No branches or pull requests

2 participants