Are multiple client consumers possible in hornetq?

点点圈 提交于 2019-12-01 00:29:20

Think of it as 1 to 1 between threads and sessions. (Connections are thread safe, everything "below" is not). So in short, create multiple threads, have each thread create a session etc. And each thread will consume.

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!