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

Support for multiple RabbitTemplate beans in the ApplicationContext #12

Open
sudr opened this issue Jan 14, 2019 · 12 comments
Open

Support for multiple RabbitTemplate beans in the ApplicationContext #12

sudr opened this issue Jan 14, 2019 · 12 comments
Labels
enhancement New feature or request ideal-for-contribution An issue that a contributor can help us with

Comments

@sudr
Copy link
Contributor

sudr commented Jan 14, 2019

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.

public RabbitMqSendTracingAspect rabbitMqSendTracingAspect(RabbitTemplate rabbitTemplate) {

@ask4gilles ask4gilles added bug Something isn't working ideal-for-contribution An issue that a contributor can help us with enhancement New feature or request and removed bug Something isn't working labels Jan 15, 2019
@ask4gilles
Copy link
Collaborator

Do you want to submit a PR for the next release?

@sudr
Copy link
Contributor Author

sudr commented Feb 21, 2019

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.

@wuyupengwoaini
Copy link

Looking forward to this feature.

@ask4gilles ask4gilles modified the milestones: 0.1.1, 0.1.2 Mar 4, 2019
@ask4gilles ask4gilles removed this from the 0.1.2 milestone May 29, 2019
@ask4gilles
Copy link
Collaborator

I just did some tests with several rabbit templates defined and it works now. Feel free to reopen this if needed.

@arseny-tl
Copy link

@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?

@arseny-tl
Copy link

arseny-tl commented Jun 1, 2020

Also, i got the idea how to fix this - simply use ((RabbitTemplate) pjp.getTarget()).getMessageConverter and so on in aspect.

@ask4gilles ask4gilles reopened this Jun 1, 2020
@arseny-tl
Copy link

@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?

@ask4gilles
Copy link
Collaborator

@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?

@zouyx
Copy link

zouyx commented Jun 24, 2021

anything update?

@folaraz
Copy link

folaraz commented Nov 27, 2022

please any update on this? @ask4gilles.
@sudr were you able to find a workaround?
thanks

@ask4gilles
Copy link
Collaborator

@folaraz This project is not maintained anymore

@folaraz
Copy link

folaraz commented Nov 30, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ideal-for-contribution An issue that a contributor can help us with
Projects
None yet
Development

No branches or pull requests

6 participants