You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Shine <ac...@club.webhop.org> on 2012/06/01 13:03:17 UTC

Performance: queues/topics vs. selectors

Hi,

i would like to create an appliction like a chat. Every client/Consumer can
send (publish) a message to every other client, but not send one message to
all (no broadcast).
What is the best way/practice to get the best performance?
- Every client consume their own topic/queue? The messagebroke has to manage
many many topics/queues.
  -> Publisher send the message to the client topic/queue.
- All clients consume the same topic with a selector like 'clientid=abcdX'
 -> Publisher send the message to the topic with the property
'clientid=abcdX'

best regards
Shine


--
View this message in context: http://activemq.2283324.n4.nabble.com/Performance-queues-topics-vs-selectors-tp4652915.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Performance: queues/topics vs. selectors

Posted by Shine <ac...@club.webhop.org>.
Hi,

thanks for your hints ... 

To delete the inactive Queue is a good idea.  I would like to set the check
period to "2 days" instead of "soconds" .. is it OK?

best regards
Shine

--
View this message in context: http://activemq.2283324.n4.nabble.com/Performance-queues-topics-vs-selectors-tp4652915p4653085.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Performance: queues/topics vs. selectors

Posted by Raul Kripalani <ra...@fusesource.com>.
I suggest you go for the one-destination-per-chatter model, and perhaps
enable automatic deletion of inactive destinations to control the use of
resources in an elastic manner.

Look at http://activemq.apache.org/delete-inactive-destinations.html.

Hope that helps.

Regards,

*Raúl Kripalani*
Principal Consultant | FuseSource Corp.
raul@fusesource.com | fusesource.com <http://www.fusesource.com/>
skype: raul.fuse | twitter: @raulvk <http://twitter.com/raulvk>,
@fusenews<http://twitter.com/fusenews>
blog: F3 - Flashes From the
Field<http://blog.raulkr.net/?utm_source=fusesourceemail&utm_medium=email&utm_campaign=fusesourcemail>

<http://twitter.com/fusenews>

On 5 June 2012 06:25, Shine <ac...@club.webhop.org> wrote:

> Hi,
>
> thanks for your response.
>
> There will be ~250 clients and all clients are almost connected at the same
> time. All messages expire after 150 seconds.
>
> best regard
> Shine
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Performance-queues-topics-vs-selectors-tp4652915p4652971.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: Performance: queues/topics vs. selectors

Posted by Shine <ac...@club.webhop.org>.
Hi,

thanks for your response.

There will be ~250 clients and all clients are almost connected at the same
time. All messages expire after 150 seconds.

best regard
Shine

--
View this message in context: http://activemq.2283324.n4.nabble.com/Performance-queues-topics-vs-selectors-tp4652915p4652971.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Performance: queues/topics vs. selectors

Posted by Raul Kripalani <ra...@fusesource.com>.
How many clients will you have? i.e. potential destinations if you follow
the 1-destination-per-chatter model? Will they all be connected at the same
time? Do messages expire? Are messages volatile, or do you need to save
them in case chatters have disconnected?

If you can avoid a "single destination + selectors" model, then do so.
That's because selectors are only evaluated against messages paged in from
the persistent store. So you could easily get into a situation where your
consumers stop receiving outstanding messages because one of them
disconnected, and there's more unmatched messages than the maximum page
size. Therefore, dispatch blocks until a matching consumer re-connects.

By default, 200 messages are loaded from persistent store to memory for
selector evaluation and dispatch, but you can alter that value setting a
maxPageSize in the destination policies (
http://activemq.apache.org/per-destination-policies.html).

If you can answer the first questions, I can provide more guidance.

Regards,

*Raúl Kripalani*
Principal Consultant | FuseSource Corp.
raul@fusesource.com | fusesource.com <http://www.fusesource.com/>
skype: raul.fuse | twitter: @raulvk <http://twitter.com/raulvk>,
@fusenews<http://twitter.com/fusenews>

<http://twitter.com/fusenews>

On 1 June 2012 12:03, Shine <ac...@club.webhop.org> wrote:

> Hi,
>
> i would like to create an appliction like a chat. Every client/Consumer can
> send (publish) a message to every other client, but not send one message to
> all (no broadcast).
> What is the best way/practice to get the best performance?
> - Every client consume their own topic/queue? The messagebroke has to
> manage
> many many topics/queues.
>  -> Publisher send the message to the client topic/queue.
> - All clients consume the same topic with a selector like 'clientid=abcdX'
>  -> Publisher send the message to the topic with the property
> 'clientid=abcdX'
>
> best regards
> Shine
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Performance-queues-topics-vs-selectors-tp4652915.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>