activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "tommy.li" <tommyl...@gmail.com>
Subject reconnection in a network of brokers
Date Thu, 22 Mar 2007 09:21:50 GMT

Here's my problem:
There are 3 servers (IP=192.168.0.219, 192.168.0.135 and 192.168.0.137).
Servers 1 sends messages to server 3 through server 2.
I used apache-activemq-4.1-20070320.072657-13.tar.gz for my first tests.

1.
*_activemq.xml file for server 1 was :_*
.......................................................................
<broker brokerName="emv219" useJmx="true"
xmlns="http://activemq.org/config/1.0">
.......................................................................
    <persistenceAdapter>
        <journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.base}/activemq-data"/>
      <!-- To use a different datasource, use the following syntax : -->
      <!--
      <journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data"
dataSource="#postgres-ds"/>
       -->
    </persistenceAdapter>

    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
       <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
    </transportConnectors>

    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <!--
      <networkConnector name="default-nc" uri="multicast://default"/>
      -->
      <!--
      <networkConnector name="host1 and host2"
uri="static://(tcp://host1:61616,tcp://host2:61616)" failover="true"/>
      -->
      <networkConnector name="host135"
uri="static://(tcp://192.168.0.135:61616)" networkTTL="255"
decreaseNetworkConsumerPriority="
false" failover="true"/>
    </networkConnectors>
.............................................................................

2.
*_activemq.xml file for server 2 was :_*
.......................................................................
<broker brokerName="emv135" useJmx="true"
xmlns="http://activemq.org/config/1.0">
.......................................................................
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
       <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
    </transportConnectors>

    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <!--
      <networkConnector name="default-nc" uri="multicast://default"/>
      -->
      <!--
      <networkConnector name="host1 and host2"
uri="static://(tcp://host1:61616,tcp://host2:61616)" failover="true"/>
      -->
      <networkConnector name="host219 and host137"
uri="static://(tcp://192.168.0.219:61616,tcp://192.168.0.137:61616)"
networkTTL="
255" decreaseNetworkConsumerPriority="false" failover="true"/>
    </networkConnectors>
........................................................................
3.
*_activemq.xml file for server 3 was :_*
.......................................................................
<broker brokerName="emv137" useJmx="true"
xmlns="http://activemq.org/config/1.0">
.......................................................................
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
       <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
    </transportConnectors>

    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <!--
      <networkConnector name="default-nc" uri="multicast://default"/>
      -->
      <!--
      <networkConnector name="host1 and host2"
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
      -->
      <networkConnector name="host135"
uri="static://(tcp://192.168.0.135:61616)" networkTTL="255"
decreaseNetworkConsumerPriority="
false" failover="true"/>
    </networkConnectors>
.................................................................................

If i restart server1 or server 3 ,then server 2 prints the messages:
java.io.EOFException
        at java.io.DataInputStream.readInt(DataInputStream.java:358)
        at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:267)
        at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:156)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:136)
        at java.lang.Thread.run(Thread.java:595)
WARN  TransportConnection            - Unexpected extra broker info command
received: BrokerInfo {commandId = 6, responseRequired = false, brokerId =
ID:emv219n-33945-1174458770157-1:0, brokerURL = tcp://emv219n:61616,
slaveBroker = false, masterBroker = false, faultTolerantConfiguration =
false, networkConnection = false, duplexConnection = false, peerBrokerInfos
= [], brokerName = emv219, connectionId = 0}.
INFO  FailoverTransport              - Transport failed, attempting to
automatically reconnect due to: java.io.EOFException
java.io.EOFException
        at java.io.DataInputStream.readInt(DataInputStream.java:358)
        at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:267)
        at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:156)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:136)
        at java.lang.Thread.run(Thread.java:595)
WARN  TransportConnection            - Unexpected extra broker info command
received: BrokerInfo {commandId = 5, responseRequired = false, brokerId =
ID:emv137-47103-1174550904165-1:0, brokerURL = tcp://emv137:61616,
slaveBroker = false, masterBroker = false, faultTolerantConfiguration =
false, networkConnection = false, duplexConnection = false, peerBrokerInfos
= [], brokerName = emv137, connectionId = 0}

Thanks.
-- 
View this message in context: http://www.nabble.com/reconnection-in-a-network-of-brokers-tf3446355s2354.html#a9610892
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message