Also, network connectors at the moment are uni-directional, which means that if brokerA has a network connector that connects to brokerB, brokerA can send messages to brokerB, but brokerB cannot send messages to brokerA. See https://issues.apache.org/activemq/browse/AMQ-920. In your config below, the embedded brokers can send messages to the remote broker, but the remote broker cannot send messages to the embedded brokers.

Adrian Co wrote:
ktrue wrote:
Hi guys,


Adrian Co wrote:
For me, one of the key use of embedding brokers in the client, is that clients can continue processing stuff even when the remote broker is down. AFAIK, using the failover protocol, will block the sending of a message until the client is able reconnect to the broker. If you use an embedded broker, messages will be persisted automatically, and be sent when the remote broker comes online again, and the actual producer need not worry about it. I don't think theres not much use for a failover:vm://client as using an embedded broker assumes that if a broker goes down, the client in essence is also down.

Adrian, I wanted to share with you the previous "network of brokers"
configuration that was used in our product that didn't seem to implement
failover as expected.
Previously the server defined a broker thusly:

    <beans xmlns="http://activemq.org/config/1.0";>
        <broker brokerName="adminserver" useJmx="false"
useShutdownHook="false">
            <transportConnectors>
                <transportConnector name="default"
uri="tcp://localhost:61616"/>
            </transportConnectors>
            <networkConnectors>
                <networkConnector name="default"
uri="static:tcp://localhost:61616"/>
            </networkConnectors>
        </broker>
    </beans>
I find this part odd. You have a network connector to tcp://localhost:61616, and you're exposing the same transport connector. Seems that you're connecting to yourself? I'm not sure if this is the actual problem, its just odd.
The previous configuration of the clients included an embedded broker as
well:

    <bean id="jmsBroker"
      class="org.apache.activemq.broker.BrokerService"
      init-method="start"
      destroy-method="stop">
        <property name="brokerName" value="cruncheragent"/>
        <property name="useJmx" value="false"/>
        <property name="useShutdownHook" value="false"/>
        <property name="networkConnectorURIs">
            <list>
                <value>static:(failover:(tcp://localhost:61616))</value>
            </list>
        </property>
    </bean>
    <bean id="jmsConnectionFactory"
      class="org.apache.activemq.pool.PooledConnectionFactory"
      init-method="start"
      destroy-method="stop">
        <property name="connectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <property name="brokerURL" value="vm://cruncheragent"/>
            </bean>
        </property>
    </bean>
However, what happened when I stopped the server (broker "adminserver"), I
get this message in the client:

    2006-11-17 16:20:41,588 WARN
[org.apache.activemq.network.DemandForwardingBridge] - Unexpected remote command:
ShutdownInfo {commandId = 52, responseRequired = false}
    2006-11-17 16:20:41,590 WARN
[org.apache.activemq.network.DemandForwardingBridge] - Outbound transport to
adminserver interrupted ...

However, once I start the server, I never see any further messages about the matter and the clients don't appear to reconnect (i.e. I never see messages on the server from the clients again). HOWEVER, if I don't use an embedded broker on the client and use failover:tcp://localhost:61616, the messages
are sent to the server when it is once again available.

In short, it seems like sticking an embedded broker in between the
ConnectionFactory and the server seems to break failover.

Additionally, you asked:

Could be if you are connecting to other JMS brokers aside from AMQ, but
if you are networking
    ActiveMQ brokers only, I don't think so.

Just to rule that out, no, I'm only connecting to ActiveMQ servers.

Adrian and Gabriel: thanks for your input and help so far.

Thanks!
Kirk


Reply via email to