Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

New Queues, Exchanges, Bindings not been created. #54

Closed
ocristian opened this issue Mar 8, 2021 · 2 comments · Fixed by #63
Closed

New Queues, Exchanges, Bindings not been created. #54

ocristian opened this issue Mar 8, 2021 · 2 comments · Fixed by #63
Assignees
Labels

Comments

@ocristian
Copy link
Collaborator

ocristian commented Mar 8, 2021

Queues, exchanges or bindings not existing in the broker yet are not being automatically created when using @RabbitListener.

A possible root cause for it is because we have specific declaringAdmins, in those declarebles created by MultiRabbit.
This info is evaluated by RabbitAdmin while filtering the declarables.

Here, we can see the obj status during that evaluation.
Queue declaringAdmins is different than this.beanName

dec = {Queue@11016} "Queue [name=new-queue-name, durable=true, autoDelete=false, exclusive=false, arguments={},   actualName=new-queue-name]"  
 name = "new-queue-name"   
 durable = true  
 exclusive = false  
 autoDelete = false    
 actualName = "new-queue-name"  
 shouldDeclare = true  
 declaringAdmins = {ArrayList@11026}  size = 1  
  0 = "eventbus-admin" 
 ignoreDeclarationExceptions = true  
 arguments = {HashMap@11027}  size = 0  
this.explicitDeclarationsOnly = false  
this.beanName = "amqpAdmin"  
rwanderc added a commit that referenced this issue Mar 9, 2021
@rwanderc rwanderc self-assigned this Mar 9, 2021
@rwanderc rwanderc added bug Something isn't working v2.4.0 labels Mar 9, 2021
@rwanderc
Copy link
Contributor

rwanderc commented Mar 9, 2021

Thank @ocristian for opening the issue. That's fixed in main and will be merged and released in 2.4.0.

ocristian added a commit that referenced this issue May 19, 2021
…r bindings. (#63)

It was being overwritten, as we were using its reference instead of a new instance.
In addition, the bean name was being set after calling afterPropertiesSet, which caused the registered bean to have no name.
Those two problems cause that during the declaration of the queues,exchange or bindings, the registered RabbitAdmin was not identified as DeclarableAdmins.
RabbitAdmin filter the declarebles here: RabbitAdmin.filterDeclarables(.....) and the admin checks here: declarableByMe(...)

Introducing Github Actions to build, release and publishing artifacts to maven central
@ocristian
Copy link
Collaborator Author

Issue fixed on release v2.4.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

2 participants