[openamq-dev] HA pair & Wire API

Martin Sustrik sustrik at imatix.com
Thu Dec 13 09:31:21 CET 2007


Hi Dmitri,

> I have implemented failover in application, but I see one little
> problem. I was expecting (hoping) that same queues with the same
> bindings will be created on a backup broker in HA pair when it is
> standing by... but looks like this is not happening. So when my apps
> failover to a backup, I need to recreate all queues and bindings.
> Because I have a case when one application creates a queue and another
> consumes it, I may have some raising conditions here.

Unfortunately, wiring isn't replicated from the primary broker to the 
standby.

However, it should cause no problem. Let me explain.

AMQP was designed specifically with zero-config feature in mind. I.e. 
download the software, install it on 1000 servers of your server farm, 
do no configuration, run your apps. Each apps should create the wiring 
(exhcanges, queues, bindings) it needs itself.

Therefore, in case of failover, the app should reconnect to the backup 
broker and run the wiring code once again.

Note that exchange_declare, queue_declare and queue_bind functions 
create the object if it does not exist. In case it already exists, the 
functions do nothing and complete without complaining. So, if your 
publisher & consumer applications need access to the same queue, both of 
them should declare it. That way, the queue will be created once the 
first application (whether consumer of publisher) is started.

> I was trying to use MTA cluster along with HA pair configuration, but
> this didn't help, unless I missed something.

MTA is intended for the environments, where different parts of the 
system have different geographical location and the communication 
between them is slow. In that case MTA allows you to have 2 brokers (one 
on each location) working in parallel, so that apps don't have to 
connect to the remote broker... this has nothing to do with failover.

Martin


More information about the openamq-dev mailing list