activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gaurav Hariani <g.activ...@blackspark.com>
Subject Network/Cluster of Brokers - What I learnt
Date Tue, 27 Feb 2007 16:38:33 GMT
I managed to partially get a network of brokers working. This is what I 
learnt in the process.

   1. All brokers in the network should use a different name.
   2. "Transport Connector" is what clients and peer brokers communicate
      with a broker using. So if you have a transport connector like
      <transportConnector name="openwire" uri="tcp://localhost:61616"/>
      the broker can talk on tcp://localhost:61616
   3. "Network Connector" is what the broker uses to connect other
      brokers. So if you have       <networkConnector name="host1 and
      host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/> then
      the broker will try to connect to other brokers running with
      transport connectors tcp://host1:61616 and tcp://host2:61616

Still trying to figure out how to get failover going .... the clients 
don't switch over to other brokers but just exit.



Nagavardhan Sogal wrote:
> Different names
>
>
>  
> On 2/27/07, *Gaurav Hariani* <g.activemq@blackspark.com 
> <mailto:g.activemq@blackspark.com>> wrote:
>
>     Hi Naga,
>
>     Do you have different names for the brokers ... or do you use the
>     same name?
>     I've been using the same name.
>
>     Gaurav
>
>     Nagavardhan Sogal wrote:
>     > yes.
>     >
>     > Thanks
>     > Naga
>     >
>     >
>     > On 2/26/07, *Gaurav Hariani* <g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>
>     > <mailto:g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>>> wrote:
>     >
>     >     I don't need multicast. So should I change the
>     >     <transportConnector> to
>     >          <transportConnector name="openwire"
>     uri="tcp://host1:61616"/>
>     >     ?
>     >
>     >
>     >
>     >
>     >     Nagavardhan Sogal wrote:
>     >     > Hi
>     >     >   Do you need multicast? because ur network bride is between
>     >     host1 and
>     >     > host2/
>     >     >
>     >     >  also in the networkconnector you don't need to include the
>     >     localhost,
>     >     > you only need remotehost.
>     >     >
>     >     > Thanks
>     >     > Naga
>     >     >
>     >     >
>     >     > On 2/26/07, *g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>
>     >     <mailto: g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>>
>     >     > <mailto: g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>
>     >     <mailto:g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>>>* <g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>
>     >     <mailto:g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>>
>     >     > <mailto: g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>
>     >     <mailto:g.activemq@blackspark.com
>     <mailto:g.activemq@blackspark.com>>>> wrote:
>     >     >
>     >     >     I'm using 4.1
>     >     >
>     >     >     This is the config for host1:
>     >     >     <beans>
>     >     >     <bean
>     >     >
>     >    
>     class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
>
>     >
>     >     >     "/>
>     >     >     <broker brokerName="localhost" useJmx="true"
>     >     >     xmlns="http://activemq.org/config/1.0
>     <http://activemq.org/config/1.0>" persistent="false">
>     >     >        <transportConnectors>
>     >     >           <transportConnector name="openwire"
>     >     uri="tcp://host1:61616"
>     >     >     discoveryUri="multicast://default"/>
>     >     >        </transportConnectors>
>     >     >
>     >     >        <networkConnectors>
>     >     >          <networkConnector name="host2 and host1"
>     >     >     uri="static://(tcp://host1:61616,tcp://host2:61616)"
>     >     >     failover="true"/>
>     >     >        </networkConnectors>
>     >     >     </broker>
>     >     >     </beans>
>     >     >
>     >     >
>     >     >     The config for host2 is identical except for the
>     >     >     <transportConnector ...> line is
>     >     >     <transportConnector name="openwire"
>     uri="tcp://host2:61616"
>     >     >     discoveryUri="multicast://default"/>
>     >     >
>     >     >
>     >     >     naga007 wrote:
>     >     >     >
>     >     >     > which version of activemq are using, iam using 4.1
>     and i could
>     >     >     failover
>     >     >     > also send me ur config.
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     > use failover:(tcp://host1:61616,tcp://host2:61616)
>     uri format
>     >     >     for the
>     >     >     > client.s
>     >     >     >
>     >     >     >
>     >     >     > I'm trying to setup a cluster of Brokers
>     (standalone) which
>     >     >     clients can
>     >     >     > connect to (ideally I would like them to be discovered)
>     >     >     > listening to a TOPIC. In the case of a broker
>     failing, the
>     >     clients
>     >     >     > connected to that broker should reconnect to another
>     broker.
>     >     >     >
>     >     >     > I'm able to get clients to connect to a random broker
>     >     (given a
>     >     >     static
>     >     >     > list), but when I kill a broker, clients connected
>     to that
>     >     >     broker die with
>     >     >     > the following exception:
>     >     >     >
>     >     >     > Feb 23, 2007 4:28:47 PM
>     >     >     >
>     org.apache.activemq.transport.failover.FailoverTransport
>     >     >     > handleTransportFailure
>     >     >     > INFO: Transport failed, attempting to automatically
>     reconnect
>     >     >     due to:
>     >     >     > java.net.SocketException: Connection reset
>     >     java.net.SocketException:
>     >     >     > Connection reset
>     >     >     >        at java.net.SocketInputStream.read(Unknown
>     Source)
>     >     >     >        at
>     >     >     >
>     org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill
>     >     >     (TcpBufferedInputStream.java:49)
>     >     >     >        at
>     >     >     >
>     >     >
>     >     org.apache.activemq.transport.tcp.TcpBufferedInputStream.read
>     >     (TcpBufferedInputStream.java:56)
>     >     >     >        at java.io.DataInputStream.readInt(Unknown
>     Source)
>     >     >     >        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(Unknown Source)
>     >     >     >
>     >     >     > Also restarting the broker and the disconnected
>     clients the
>     >     >     restarted
>     >     >     > clients don't get messages from the other clients.
>     >     >     >
>     >     >     > The clients are using the following URL to connect:
>     >     >     >
>     >     >
>     >    
>     java.naming.provider.url=static://(tcp://host1:61616,tcp://host2:61616)?failover=true
>
>     >     >
>     >     >     >
>     >     >     >
>     >     >     > The brokers are configured with the following
>     >     >     >
>     >     >     > host1:
>     >     >     >    <transportConnectors>
>     >     >     >       <transportConnector name="openwire"
>     >     uri="tcp://host1:61616"
>     >     >     > discoveryUri="multicast://default"/>
>     >     >     >    </transportConnectors>
>     >     >     >    <networkConnectors>
>     >     >     >      <networkConnector name="host1 and host2"
>     >     >     > uri="static://(tcp://host1:61616,tcp://host2:61616)"
>     >     >     failover="true"/>
>     >     >     >    </networkConnectors>
>     >     >     >
>     >     >     >
>     >     >     > host2:
>     >     >     >    <transportConnectors>
>     >     >     >       <transportConnector name="openwire"
>     >     uri="tcp://host2:61616"
>     >     >     > discoveryUri="multicast://default"/>
>     >     >     >    </transportConnectors>
>     >     >     >    <networkConnectors>
>     >     >     >      <networkConnector name="host1 and host2"
>     >     >     > uri="static://(tcp://host1:61616,tcp://host2:61616)"
>     >     >     failover="true"/>
>     >     >     >    </networkConnectors>
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     > Is there something obvious that I'm missing.
>     >     >     > Also is there possible to use similar clients using the
>     >     .NET API?
>     >     >     >
>     >     >     > Thanks,
>     >     >     >
>     >     >     > Gaurav Hariani
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     Quoted from:
>     >     >
>     >    
>     http://www.nabble.com/Network-Cluster-of-Brokers---Please-help-tf3293180s2354.html#a9168667
>     <http://www.nabble.com/Network-Cluster-of-Brokers---Please-help-tf3293180s2354.html#a9168667>
>     >    
>     <http://www.nabble.com/Network-Cluster-of-Brokers---Please-help-tf3293180s2354.html#a9168667>
>
>     >     >
>     >    
>     <http://www.nabble.com/Network-Cluster-of-Brokers---Please-help-tf3293180s2354.html#a9168667
>     <http://www.nabble.com/Network-Cluster-of-Brokers---Please-help-tf3293180s2354.html#a9168667>>
>     >
>     >     >
>     >     >
>     >
>     >
>
>


Mime
View raw message