You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by maksimenko <sa...@gmail.com> on 2015/03/05 15:58:20 UTC
consume one MessageGroup by several consumers
hi
I have set of messages that are sent to queue. Each message has type
property which specified how to handle it. I have several consumers which
process this messages.
I send , say 1000 messages with type A and then 1000 messages with type B.
If processing messages of type A is time consuming, then all messages with
type B have to wait a long time when they are start processing.
I wanted to solve this problem with MessageGroups which allow me to start
consuming messages with type B as soon as they created. But from guide I
understand that only one consumer is assigned to each message group. Is it
possible to customize this and allow say 10 consumers consume messages for
each group?
--
View this message in context: http://activemq.2283324.n4.nabble.com/consume-one-MessageGroup-by-several-consumers-tp4692555.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: consume one MessageGroup by several consumers
Posted by artnaseef <ar...@artnaseef.com>.
Selectors would work, but I recommend to avoid them - they can lead to
confusion and problems. For example, adding consumers with selectors to a
queue with a large backlog of messages means every one of those messages
must be evaluated against the selector to see if it matches, hurting
performance. Also, one question that comes up often on the boards - "I have
unconsumed messages" - and selectors sometimes lead to this confusion.
For the Op -- is it possible to rework the solution to use two different
queues? Queues are just that - a first-in, first-out structure for
messages. If two sets of messages should not affect each other, then
separate queues is likely the best approach.
--
View this message in context: http://activemq.2283324.n4.nabble.com/consume-one-MessageGroup-by-several-consumers-tp4692555p4692580.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: consume one MessageGroup by several consumers
Posted by Tim Bain <tb...@alumni.duke.edu>.
If there's a finite list of types, you could use message selectors on your
consumers to partition certain types to certain groups of consumers. It
won't be as dynamic as message groups are, but if the possible types aren't
dynamic then that doesn't matter anyway. Just be aware that message
selectors can have a performance impact (which is often negligible but can
be significant), so make sure you measure how much impact this change has
on your performance and adjust accordingly.
Tim
On Thu, Mar 5, 2015 at 7:58 AM, maksimenko <sa...@gmail.com>
wrote:
> hi
>
> I have set of messages that are sent to queue. Each message has type
> property which specified how to handle it. I have several consumers which
> process this messages.
>
> I send , say 1000 messages with type A and then 1000 messages with type B.
> If processing messages of type A is time consuming, then all messages with
> type B have to wait a long time when they are start processing.
>
> I wanted to solve this problem with MessageGroups which allow me to start
> consuming messages with type B as soon as they created. But from guide I
> understand that only one consumer is assigned to each message group. Is it
> possible to customize this and allow say 10 consumers consume messages for
> each group?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/consume-one-MessageGroup-by-several-consumers-tp4692555.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>