On 4/19/07, Pete Schwamb <[EMAIL PROTECTED]> wrote:

I'm using activemessaging to connect to a stomp interface on an ActiveMQ
broker, and having trouble processing all of the messages that are coming
over my subscription to a topic.

The messages take a fair amount of cpu as they must be unzipped, processed,
and stored to the db.  So much that I'd like to add another processor
(subscriber) to help keep up with the message flow, but I'm not sure how to
make two clients feed off of the same topic (not a queue, currently).

As soon as you want to load balance messages across multiple consumers
you want a queue...
http://activemq.apache.org/how-does-a-queue-compare-to-a-topic.html

as thats exactly what they do.

If you really want to keep the publish/subscribe semantics (so the
producer has no idea how many consumers/queues there might be) then
try using Virtual Topics

http://activemq.apache.org/virtual-destinations.html

but I'd recommend just starting with a queue.

I'd rather keep it a non-durable subscription, as I have a
MaximumPendingMessageLimit set and would like to discard messages when the
subscribers can't keep up.

Make sure to keep the prefetch down low if you want to enable eager
discarding of messages on slow consumers.
http://activemq.apache.org/what-is-the-prefetch-limit-for.html

as the MaximumPendingMessageLimit kicks in only above the prefetch
value (which is by default pretty high for topics)

--
James
-------
http://macstrac.blogspot.com/

Reply via email to