I'm not aware of any mechanism for controlling the assignment of message groups to consumers. I expect it would be possible for you to customize the broker's code to do this, but that's not code that I've looked at recently so I'm not sure how complicated it would be to do. Alternatively, you could submit a feature request in JIRA and it's possible that someone might implement this feature at some point.
If you need the ability to do this today with a message broker that supports this out of the box, I know that Kafka supports this. It's a more complicated message broker and does certain things differently (e.g. it doesn't support queues or competing-consumer semantics), so it might not meet your needs, but it's worth considering if you're not up for attempting to implement the feature yourself. Tim On Fri, Feb 28, 2020 at 9:31 AM subbu.kobra <[email protected]> wrote: > Hi, > > We are using active mq in our project we have a requirement that group of > messages which belongs to one Group should be consumed by one consumer > thread. > > for instance, we have 3 (M1, M2, M3) messages belongs person A and 3 (M4, > M5, M6) messages belongs person B. > > our requirement is: all messages belongs to Person A should be consumed by > Consumer thread 1 and all messages belongs to Person B should be consumed > by > consumer thread 2. > > Based on the ActiveMQ documentation and per our understanding, we have used > JMXGroupId concept in activemq. For instance, we have set JMSXGroupId as > "123" for all messages (M1, M2, M3) belongs to Person A and "234" for all > messages (M4, M5, M6) belongs to Person B. > > with JMXGroupId, in some cases, all messages beongs to Person A & B (M1, > M2, > M3, M4, M5 , & M6) are going to same consumer thread 1. > > But in our requirement it should be going to two different threads. > > Can anyone help me how to achieve this requirement? > > Thanks, > Bala > > > > -- > Sent from: > http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html >
