Message groups pattern - "late" consumers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Message groups pattern - "late" consumers

sburczymucha
Hello,

I'm looking for a message pattern - something like message groups. I would like to have one or more consumers/workers that process messages from a queue, each message is tied with specific device and needs to be processed in the order received on a per-device context, so at one time only one consumer should process messages for specific device. Number of devices and a number of consumers varies. The problem with message groups is that if I add a consumer at later stage it will be idle (already running consumers acquired all groups). How can I prevent this? Or maybe I can use some other message pattern?

Thank you very much, best regards!
Stefek
Reply | Threaded
Open this post in threaded view
|

Re: Message groups pattern - "late" consumers

Tim Bain
As far as I know there's no built-in way to rebalance JMSMessageGroups
across consumers, but i think that if you periodically close the message
group (every ten minutes?), when the next message comes in for that group
it should be eligible to be consumed by any consumer.  But since I've never
used message groups, you'll want to check that theory.

You'd also need to confirm that your consumers' business logic will
properly handle the case where a new consumer picks up processing a message
group after one of these closes.
On Jan 30, 2015 4:44 PM, "sburczymucha" <[hidden email]> wrote:

> Hello,
>
> I'm looking for a message pattern - something like message groups. I would
> like to have one or more consumers/workers that process messages from a
> queue, each message is tied with specific device and needs to be processed
> in the order received on a per-device context, so at one time only one
> consumer should process messages for specific device. Number of devices and
> a number of consumers varies. The problem with message groups is that if I
> add a consumer at later stage it will be idle (already running consumers
> acquired all groups). How can I prevent this? Or maybe I can use some other
> message pattern?
>
> Thank you very much, best regards!
> Stefek
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Message-groups-pattern-late-consumers-tp4690725.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>