Git Product home page Git Product logo

Comments (9)

garyrussell avatar garyrussell commented on April 20, 2024

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.

robertYang1024 avatar robertYang1024 commented on April 20, 2024

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.

robertYang1024 avatar robertYang1024 commented on April 20, 2024

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

garyrussell avatar garyrussell commented on April 20, 2024
  1. 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).

  1. The server does the routing; the publishing client does not know what is bound to the exchange.

  2. If there is a channel in the cache, then connection.createChannel(...) gets one from the cache, otherwise it creates one. When a channel is close()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.

robertYang1024 avatar robertYang1024 commented on April 20, 2024

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

garyrussell avatar garyrussell commented on April 20, 2024

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.

robertYang1024 avatar robertYang1024 commented on April 20, 2024

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

artembilan avatar artembilan commented on April 20, 2024

Depends of your mandatory and immediate options: https://stackoverflow.com/questions/6386117/rabbitmq-use-of-immediate-and-mandatory-bits

from spring-amqp.

garyrussell avatar garyrussell commented on April 20, 2024

Closing due to lack of activity; please reopen if you still feel there is an issue.

from spring-amqp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.