JMS queue with multiple consumers

后端 未结 2 1733
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 14:23

I have a JBoss-6 server with HornetQ and a single queue:

  
      

         


        
2条回答
  •  被撕碎了的回忆
    2020-12-03 15:02

    With multiple consumers on a queue, messages are load balanced between the consumers.

    As you have some time consuming the message, you should disable buffering by setting consumer-window-size.

    On hornetQ there's an example on the distribution, about how to disable client buffering and give a better support for slow consumers. (a slow consumer is a consumer that will have some time processing the message)

    message systems will pre-fetch/read-ahead messages to the client buffer to speed up processing and avoid network latency. This is not an issue if you have fast processing queues and a single consumer.

    JBoss Messaging offered the slow-consumer option at the connection factory and hornetq offers the consumer window size.

    Most Message systems will provide you a way to enable or disable client pre-fetching.

提交回复
热议问题