2
votes

Say we have a producer in datacentre A and an ActiveMQ broker and consumer in datacentre B.

Sending persistent, non-async messages to the broker will incur the round trip time of the network link between datacentres.

If a local broker is installed in datacentre A and configured to store and forward to B, the producer will no longer be throttled by the slow link.

Can improved end to end throughput be expected because of the network of brokers? Is it possible to control the acknowledgement mode from broker B to broker A independently of the ack mode of client to broker B?

2

2 Answers

1
votes

A network of brokers will not increase the throughput, in theory. In case you send persistent messages, broker to broker will always be a sync transfer. You producer will behave less slugish though, always having high speed broker connection to a local broker. This can be a nice feature if your producer has a HTTP request waiting for a message to be enqueued before the response is sent back. The messages won't make it to final destination any faster though.

If you go by non persistent messages, the throughput will increase a great deal. You can also configure broker to broker to be async. However, you need to deal with the scenario of message loss. In some scenarios this can be handled by application level logic, but in other scenarios it's not possible, or too much effort.

0
votes

Yes, you can control whether the sends are done synchronously or asynchronously on each link via the jms.useAsyncSend=true URI option (see http://activemq.apache.org/async-sends.html), but are you sure you want them to be different along different paths? If you use async sends on one link but not another, you're still at risk of losing messages if something goes wrong.

So either that's unacceptable and your local broker would just be moving the bottleneck from one process to another (in which case your best bet might be to send the messages transactionally, since those sends can be asynchronous) or it's acceptable (in which case just set that URI option on your producer and don't bother with the local broker). The only thing I see that the local broker would buy you in the latter case is that it would let you set useAsyncSend=true once and have it apply to all clients, which might be worth the effort depending on your situation.