Testing a network of brokers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Testing a network of brokers

James A. Robinson

I've written a client to exercise the network of brokers in my setup, the
intent is to use this to help monitor that all members of the network can
pull messages from each other.

Currently it's set up to generate N tests, one for each possible
combination of a broker producer and broker consumer.  So if I had

amq-prod-1a (
amq-prod-2a (

as members of the network, I'm generating tests to

publish to amq-prod-1a, consume fro amq-prod-1a
publish to amq-prod-1a, consume fro amq-prod-2a
publish to amq-prod-2a, consume from amq-prod-2a
publish to amq-prod-2a, consume from amq-prod-1a

I've got a client that work, but I think there are two issues I still need
to deal with.

1. If I have concurrent producers/consumer tests running I need to be sure
that a message produced by the test producer isn't consumed by some other
test instance for a different pair of producer/consumers.

2. I need to be sure each consumer will receive exactly one message, so
that if two tests are running and testing the same combination of
producer/consumer ip, that each consumer gets a chance to read a message.

To handle issue #1 I was thinking I'd use a naming hierarchy that used the
producer and consumer hosts ips, e.g., test.10_0_0_2.10_0_0_3 if I had
amq-prod-1a on and amq-prod-2a on, and I were producing
from 1a and reading from 2a.

To handle issue #2 I'm wondering if the correct thing to do is to set a
prefetch limit on the consumer when I connect to the broker?  It looks as
though http://activemq.apache.org/what-is-the-prefetch-limit-for.html says
I could set "consumer.prefetchSize=1" as a parameter on the broker URL.

If that's correct, does this apply to any sort of protocol that might be in
use on the broker, e.g., openwire, amqp, and stomp URLs?