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
Unexpected exchange type: headers #408
Comments
Well, pay attention, please, to the BindingBuilder.bind(new Queue("q"))
.to(new HeadersExchange("t"))
.where("foo")
.matches("bar"); But there are other configuration logical branches. So, we decided do not allow @Bean
public DirectExchange e1() {
return new DirectExchange("e1", false, true);
}
@Bean
public Queue q1() {
return new Queue("q1", false, false, true);
}
@Bean
public Binding b1() {
return BindingBuilder.bind(q1()).to(e1()).with("k1");
} Ultimately, the Hope that is clear |
The javadocs document this limitation. None of the exchanges declared by the Since the headers exchange requires arguments for the header mapping and The work around (and for any exchange requiring arguments) is to use external We can revisit this if you feel strongly about it - if so, open a JIRA Issue and we'll take a look. We'd need to add something like
Where
Now I see it laid out like that, it doesn't look like it would be too bad; however, if you configured queue arguments as well, the annotation could get very unwieldy, very quickly, and hard to read - hence my original thought that such configuration would be better done as |
The idea with the array of arguments looks great. In my opinion, this solution looks complete (all type of exchanges will be supported). |
Hi!
When I try to bind queue to headers exchange through annotation
@RabbitListener -> bindings -> @QueueBinding
, I receive exception:Unexpected exchange type: headers
I inspect class
RabbitListenerAnnotationBeanPostProcessor
and found next code:i.e. binding to headers exchange not supported in annotation
@RabbitListener
.Why?
The text was updated successfully, but these errors were encountered: