Comments (5)
Well, pay attention, please, to the @RabbitListener
with bindings
configurations.
We found it as already enough complicated.
And from other hand see the HeadersExchange
description and its binding logic in the HeadersExchangeMapConfigurer
. For example:
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 HeadersExchange
from the annotation configuration and let end-users to do their sophisticated solutions with standard BindingBuilder
and @Bean
combinations:
@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 @RabbitListener
is just for listener's method on the queue. And from big height it shouldn't know anything about bindings.
Hope that is clear
from spring-amqp.
The javadocs document this limitation.
None of the exchanges declared by the @QueueBinding
annotations support an arguments
map - it's a bit awkward to build a map using annotations.
Since the headers exchange requires arguments for the header mapping and x-match
argument, we couldn't support it without adding argument support, hence it's not currently supported.
The work around (and for any exchange requiring arguments) is to use external @Bean
definitions.
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
Argument[] arguments default {}
Where Argument
would be an annotation, something like:
{ @Argument(name="x-match", value="all",
@Argument(name="foo", value="bar",
@Argument(name="baz", value="qux" }
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 @Bean
s.
from spring-amqp.
The idea with the array of arguments looks great. In my opinion, this solution looks complete (all type of exchanges will be supported).
Write bindings on annotations isn't very nice solution. But this has a right to exist. Especially since it is already there for other types of exchanges.
from spring-amqp.
https://jira.spring.io/browse/AMQP-604
from spring-amqp.
The PR #409 has been merged 54a613a
from spring-amqp.
Related Issues (20)
- Get rid of `synchronized` in the `BlockingQueueConsumer`
- Get rid of `synchronized` in `spring-rabbit-test` module
- Get rid of the rest of `synchronized` in the ListenerContainer infrastructure
- Improve Extensibility of RepublishMessageRecovererWithConfirms by supporting SpEL expressions HOT 1
- AmqpRejectAndDontRequeueException completely restarts Consumer HOT 2
- The `SimpleMessageListenerContainer` does not shutdown properly
- The `SimpleMessageListenerContainer` does not shutdown properly HOT 1
- Swallowed exception 'AmqpTimeoutException: No available channels' HOT 4
- Add batchReceiveTimeout in SimpleMessageListenerContainer HOT 3
- MessageProperties setDelay maximum value problem HOT 3
- ImmediateAcknowledgeAmqpException keeps the message in the queue HOT 10
- TraceId propagation to the new thread local HOT 4
- Wrong ClassLoader is used for message deserialization when devtools are active
- Wrong ClassLoader is used for message deserialization when devtools are active HOT 1
- Kotlin suspend functions return type is incorrect HOT 1
- Kotlin suspend functions return type is incorrect HOT 1
- Channel cache leak when no answers from broker for pending confirms
- Channel cache leak when no answers from broker for pending confirms HOT 1
- Invoke RabbitListenerErrorHandler when the batch of the listener is enabled HOT 2
- Document that micrometer observations aren't started for batch listeners HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-amqp.