java-spring-rabbitmq
java-spring-rabbitmq copied to clipboard
Support for multiple RabbitTemplate beans in the ApplicationContext
Currently the Spring Boot auto configuration will blow up on applicaiton startup if there is more than one bean of type RabbitTemplate. It would seem useful to support a collection of RabbitTemplate beans instead for applications that have multiple RabbitTemplate beans.
https://github.com/opentracing-contrib/java-spring-rabbitmq/blob/904bd38465c790a362740ceb8cf4f7f532d35ada/opentracing-spring-rabbitmq-starter/src/main/java/io/opentracing/contrib/spring/rabbitmq/RabbitMqTracingAutoConfiguration.java#L43
Do you want to submit a PR for the next release?
I've since disabled Spring Boot's RabbitMQ AutoConfiguration for other reasons and so don't have a pressing need for this. If I have time next week I can take a look into solving this.
Looking forward to this feature.
I just did some tests with several rabbit templates defined and it works now. Feel free to reopen this if needed.
@ask4gilles Hi, i have this trouble right now. In io.opentracing.contrib.spring.rabbitmq.RabbitMqTracingAutoConfiguration bean with name rabbitMqSendTracingAspect required a single bean of rabbitTemplate. Could you check this for now, please?
Also, i got the idea how to fix this - simply use ((RabbitTemplate) pjp.getTarget()).getMessageConverter and so on in aspect.
@ask4gilles i want to try my best in my pull-request with changes. Currently, i have some work done with aspect + unit test, but have no idea how to write IT test with multiple RabbitTemplate beans. Can you help me with that? In my mind, i should create configuration with some rabbitTemplate beans in it, and then try to publish/publishAndRecieve messages, using both rabbit templates, and assert that both of them trace message. How can i organize my work on it, using already existing test utils?
@arseny-tl Thank you for raising this PR! I'll try to find some time this week to have a look at it. Perhaps @sudr could also double check?
anything update?
please any update on this? @ask4gilles. @sudr were you able to find a workaround? thanks
@folaraz This project is not maintained anymore
got it thanks @ask4gilles. is this due to the migration over to opentelemetry? if yes, please what spring boot dependencies would achieve this same result as this library? thanks