Are multiple client consumers possible in hornetq?

后端 未结 2 758
你的背包
你的背包 2021-01-06 23:00

In my client application, I create several consumers, but they can\'t concurrently process the queue. Always, only a single consumer processes the queue messages. I don\'t k

2条回答
  •  灰色年华
    2021-01-06 23:04

    By looking at your code the consumer variable is getting reassigned different consumer objects in the for loop, which may cause the references to the earlier consumer objects lost and garbage collected. Only one consumer object will remain alive-the one which was created last in the for loop- whose reference is maintained by the consumer variable and it will consume all the coming messages.

提交回复
热议问题