spring-multirabbit icon indicating copy to clipboard operation
spring-multirabbit copied to clipboard

Release version compatible with SpringBoot 3.0

Open rwanderc opened this issue 3 years ago • 13 comments

TBD:

  • double-check if SP works with the same beans

rwanderc avatar Apr 18 '22 11:04 rwanderc

I'm using it on spring boot 3.x and its working with a few workarounds, but I don't know if you working on it actively nor I could help with the 3.x compatibility.

joaquinjsb avatar Feb 14 '23 17:02 joaquinjsb

Hi @joaquinjsb. Pls feel free to submit your PR.

rwanderc avatar Feb 15 '23 09:02 rwanderc

@joaquinjsb if you could share your solution. I'm currently struggling with SB 3.0.2 which does not automatically creates beans with different AMQPs.

davidwiniarz avatar Feb 15 '23 15:02 davidwiniarz

I created a component like this:

@ConditionalOnProperty(prefix = "spring", name = "multirabbitmq.enabled", havingValue = "true")
@EnableRabbit
@Import({MultiRabbitAutoConfiguration.class, RabbitAutoConfiguration.class})
@Component
public class RabbitMQConnector { 

}

for some reason the auto scan of the package isn't working, so I just copied the parameter on my custom class, and it's working back like it used to.

joaquinjsb avatar Feb 15 '23 15:02 joaquinjsb

Well, I did as you say, but with no result. Error I'm getting : A component required a bean named "connectionNameA-admin" that could not be found.

There is no such error with SB 2.7.x

I'm using SB 3.0.2

Any ideas?

davidwiniarz avatar Feb 15 '23 16:02 davidwiniarz

do you mind creating me a sample project? I can give a look to it.

joaquinjsb avatar Feb 15 '23 16:02 joaquinjsb

Sure, here you can find it.

https://files.fm/u/3rku4nrbw

But it's working now. What I did not do... I didn't have the default @RabbitListener (each one has connectionFactory property) and then, it doesn't work. Maybe you know why?

davidwiniarz avatar Feb 15 '23 16:02 davidwiniarz

Screenshot 2023-02-15 alle 17 27 04 yay, I started it and it was working without issues, glad I could help.

EDIT: that happens because you haven't defined a default rabbitMQ connection like the docs says, if u don't use spring one, you gotta select one as the default.

joaquinjsb avatar Feb 15 '23 16:02 joaquinjsb

Thanks.

One more question. Now while connecting to AMQP server it tells me sth like: inequivalent arg 'type' for exchange 'exchange1' in vhost 'xx' - received 'direct' but current is 'topic'.

In fact, the one I'm connecting to is of type 'topic' Is this app is trying to create a new one, with the same name, but different 'type'

davidwiniarz avatar Feb 15 '23 16:02 davidwiniarz

OK, I've solved the issue by putting type in @Exchange

davidwiniarz avatar Feb 15 '23 17:02 davidwiniarz

What is the status on this issue? I would like to update to SB3 with a SB3-compatible multirabbit. I see the workaround. Can't this simply be integrated into the multirabbit project for a SB3-compatible multirabbit?

SebastianOltmanns avatar Mar 15 '23 07:03 SebastianOltmanns

On some investigation, I think the issue that appears here is documented in the release notets of SB3:

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0.0-M5-Release-Notes#auto-configuration-registration

SebastianOltmanns avatar Mar 15 '23 07:03 SebastianOltmanns

Please see #95

SebastianOltmanns avatar Mar 15 '23 08:03 SebastianOltmanns