JMS Failover Asynchronous Publisher

In our architecture, the JMS publisher can continue to work (and generate new messages) even if the connection to the local network is lost. Is it possible to make the publisher server tolerant of network disconnection or to a broker using JMS:

  • the publication of the call cannot block the application, even if the broker is not available;
  • published messages (during a shutdown) must be delivered after a network connection is restored;

As far as I understand, this can be done with a built-in (local) broker on each publishing computer. If this is the only way, are there any non-obvious issues with this topology - performance, maintenance, etc.? Will the local broker be tolerant of disconnections in and of itself?

+4
source share
3 answers

I have not tried this, but it seems that you can use a local transition to another resource to reduce the impedance: With ActiveMQ you can configure the transition to a backup resource:

failover:(tcp://primary:61616,tcp://secondary:61616)?randomize=false 

Try the following:

 client +---> primary: network broker <-------+ | | +---> secondary: embedded broker -----+ 

Here, your main broker will be the main one, and your secondary broker will be a locally integrated broker with a bridge for the main broker. It seems that this will work well when the client publishes the allocation; I'm not sure if this will be better for subscribers, and then the solution suggested by @Biju: is shown below:

 client +---> secondary: embedded broker ------> primary: network broker 

For example, this is my built-in broker (which is usually not permanent).

 <bean id="activeMQBroker" class="org.apache.activemq.broker.BrokerService"> <property name="transportConnectors"> <list> <bean id="brokerConnection" class="org.apache.activemq.broker.TransportConnector"> <property name="connectUri"> <bean id="brokerURI" class="java.net.URI"> <constructor-arg value="tcp://localhost:61616" /> </bean> </property> </bean> </list> </property> <property name="persistent" value="true" /> </bean> 
+2
source

The only way I can think of is through what you suggested -

  • Create a local embedded broker and provide a bridge from this embedded broker to the network broker. Even the local one can go down, although you may have to publish a transaction between your resources (db and jms infrastructure).
  • Do not publish directly, but instead abstract, which buffers it, into the database, file, or, as indicated above, into local embedded jms and provide a bridge, as indicated above, from the buffer to the JMS queue.
0
source

Distributed architecture, if the queue manager \ brokers are very common in the cases described by you.

The exact configuration depends on the specific product you are using, but it is usually well-documented and easy to manage.

regarding local redundancy, you can use two of these queue managers in a failover configuration (again - the exact method for creating failover clusters is product dependent) - but this seems to be a bit of an overflow.

JMS only standardizes the Message Queuing Provider API, another

0
source

Source: https://habr.com/ru/post/1341962/


All Articles