Comments (9)
Try increasing the channelCacheSize
on the CachingConnectionFactory
. It defaults to 25 but should be large enough to handle the number of concurrent send operations you expect.
from spring-amqp.
i set
spring:
rabbitmq:
channelCacheSize: 2000 ;
the error appear again
when I login into the rabbitmq management html through the port 15672 ,I found that the value of channel most of the time is 1 , the largest only 14 , i don't know why
i use
springBootVersion = '1.3.6.RELEASE'
springCloudVersion = 'Brixton.SR3' ,
Do not know if the version is too old ,I will try the latest version 。If you have any idea ,please tell me .
from spring-amqp.
@garyrussell
i upgraded the version to 1.4.5
springBootVersion = '1.4.5.RELEASE'
springCloudVersion = 'Camden.SR7'
spring-rabbit-1.6.8.RELEASE.jar
the error did not appear again.
when I send a message to a fanout exchange,
1,get a channel
2 , send message to fanout exchange
3, fanout exchange Send the message to the queue which bind to it
4, close channel
i have some questions :
question 1: Is this step right?
question 2: the step 3 ,is rabbitmq server doing this or rabbitmq client doing this thing?
question 3: what is the whole life cycle of the channel ?
Very much looking forward to your answer
from spring-amqp.
- Yes, but you might find it easier to just let the
RabbitTemplate
manage the channel for you.
template.convertAndSend("fanout", "", "foo");
or
template.send("fanout", "", message);
The template will reliably close the channel (on success or failure).
-
The server does the routing; the publishing client does not know what is bound to the exchange.
-
If there is a channel in the cache, then
connection.createChannel(...)
gets one from the cache, otherwise it creates one. When a channel isclose()
d, if there is room in the cache (channelCacheSize
) the channel is put into the cache instead of being closed. If the cache is full, the channel is actually closed.
from spring-amqp.
@garyrussell
Thank you very much for your answer, I have some more understanding of this,i am using RabbitTemplate to send the message now,It is really easier .
I now have 10 fanout exchanges , each exchanges binds 10 queues , as you know , a fanout exchange routes messages to all of the queues that are bound to it and the routing key is ignored. it worked very well in low concurrency ,but in the high concurrency(50 concurrent)of the situation was very bad .There was no error in the log , but the number of publish which i saw from the rabbitmq management page was smaller than 50 .This is not normal . This number should be large , at least it should be hundreds . So what's the problem ? If i want use fanout exchange in high concurrency , is there any good way to solve it ?
Looking forward to your reply
from spring-amqp.
I have not seen such problems as long as the channel cache size is large enough. If you can post a sample application that exhibits the behavior, I can take a look.
from spring-amqp.
@garyrussell
Thank you very much , but i would like to try it myself , if i can't fix it , i will come for your help . i I send a message to a fanout exchange which bound 10 queues , the response time is 36 mm , is the response be returned when the message arrives at the queue or the rabbitmq server exchange received a message ?
from spring-amqp.
Depends of your mandatory
and immediate
options: https://stackoverflow.com/questions/6386117/rabbitmq-use-of-immediate-and-mandatory-bits
from spring-amqp.
Closing due to lack of activity; please reopen if you still feel there is an issue.
from spring-amqp.
Related Issues (20)
- 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 3
- 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
- Unable to access AMQP Channel from RabbitListenerErrorHandler in case of MessageConversionException HOT 1
- Deadlock when reaching channel limit in DirectMessageListenerContainer HOT 5
- Remove deprecated method in the `RabbitListenerErrorHandler`
- DefaultMessagePropertiesConverter#toMessageProperties should handle x-delay in Short HOT 4
- DefaultMessagePropertiesConverter#toMessageProperties should handle x-delay in Short HOT 1
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.