开发者

Implementing ActiveMQ's sticky sessions (message groups) in JMS queues

开发者 https://www.devze.com 2023-04-10 13:11 出处:网络
I\'m trying to move off of ActiveMQ but one feature we\'d like to keep is the message group. By adding a session ID to the JMS header ActiveMQ will route all other messages on the queue with the same

I'm trying to move off of ActiveMQ but one feature we'd like to keep is the message group. By adding a session ID to the JMS header ActiveMQ will route all other messages on the queue with the same ID to the same consumer (our consumers may be on different machines) allowing the receiver to treat the gr开发者_StackOverflow社区oup of messages as one unit of work.

My first thought was simply to put the session into CLIENT_ACKNOWLEDGE mode. My thinking was that if consumer A looked at the header and saw it wasn't an ID it was handling then it could just drop the message and consumer B would pick it up. I've hit several issues, including ActiveMQ's prefecting, and the more I read, the more it looks like that's not what that was designed for to begin with.

The one idea I can think of is to have a dispatch queue which would then route messages to each consumer's, for lack of a better word, sub-queue and manage matching the session IDs to the sub-queues ourselves.

Before I head down this path, which we're leery of since it'd add more complexity to the code then we'd like, is there anything I'm missing about CLIENT_ACKNOWLEDGE? Or something else entirely I should try first?


Is this what you are trying to do http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5/html-single/HornetQ_User_Guide/index.html#message-grouping

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号