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>
source share