Posts tonen met het label ActiveMQ. Alle posts tonen
Posts tonen met het label ActiveMQ. Alle posts tonen

maandag 15 april 2013

ActiveMQ and Network Interfaces

When you are using ActiveMQ as a message broker, the need can arise to bind the queue listener to a specific network-interface. Although this is not very common and some argue that the OS should do the routing, you can face certain situations in which your software decides which network-interface SHOULD or MUST be used for the communication.

The reason could be that some communication-channels are expensive and the machine needs to switch network-interfaces on the fly because of you business logic. When the servers are not under your control you cannot simply change the OS routing tables.

There is a simple trick in ActiveMQ to select the network-interface to use, although you cannot find it in the manual -- but it is in the code. Just use the following scheme for the binding:

tcp://remote-queue-ip:61616@network-interface-ip:61616

You can also use other protocols, of course.