In our architecture JMS publisher may continue to work (and generate new messages) even if connection with local network is lost. Is it possible to make publisher server tolerant to network or broker outages with JMS:
As far as I understand it can be done with embedded (local) broker on each publishing machine. If it's the only way, are there any non obvious problems with that topology - performance, maintenance, etc? Will the local broker be tolerant to outages by itself?
I've not tried this but it seems like you could use local failover to reduce impedance: With ActiveMQ you can configure a failover transport:
failover:(tcp://primary:61616,tcp://secondary:61616)?randomize=false
To try and draw this:
client +---> primary: network broker <-------+
| |
+---> secondary: embedded broker -----+
Here primary would be your network broker, and your secondary broker would be the locally embedded broker with a bridge to the primary broker. This seems like it would work well when the client publishes allot; I'm not sure if this would be any better for subscribes then the solution put forward by @Biju: illustrated below:
client +---> secondary: embedded broker ------> primary: network broker
For example here is my embedded broker (which is usually non-persistent).
<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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With