activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Prokopiev <prokop...@stc.donpac.ru>
Subject HA network topology
Date Fri, 28 Jul 2006 11:56:19 GMT
Hi,

I tried to use this network topology with AMQ (I use raw Spring beans 
because I need 2.0 which can't with XBean):

machine m0 (192.168.46.100):

<beans>
         <bean id="broker" 
class="org.apache.activemq.broker.BrokerService" init-method="start" 
destroy-method="stop">
                 <property name="persistent" value="false"/>
                 <property name="transportConnectorURIs">
                         <list>
                                 <value>tcp://localhost:5000</value>
                         </list>
                 </property>
                 <property name="networkConnectorURIs">
                         <list>
 
<value>static:(failover:tcp://m1:5000)</value>
                         </list>
                 </property>
         </bean>
</beans>

machine m1 (192.168.46.101):

<beans>
         <bean id="broker" 
class="org.apache.activemq.broker.BrokerService" init-method="start" 
destroy-method="stop">
                 <property name="persistent" value="false"/>
                 <property name="transportConnectorURIs">
                         <list>
                                 <value>tcp://localhost:5000</value>
                         </list>
                 </property>
                 <property name="networkConnectorURIs">
                         <list>
 
<value>static:(failover:tcp://m0:5000)</value>
                         </list>
                 </property>

         </bean>
</beans>

With this configuration simple producers and consumers using connection 
string "failover:(tcp://m0:5000,tcp://m1:5000)" works fine.

But I need to produce messages just in case of m0 and m1 down. So I 
tried to create more complex producer with embedded broker configured as:

<beans>
	<bean id="broker" class="org.apache.activemq.broker.BrokerService" 
init-method="start" destroy-method="stop">
		<property name="persistent" value="false"/>
		<property name="transportConnectorURIs">
			<list>
				<value>tcp://localhost:5000</value>
			</list>
		</property>
		<property name="networkConnectorURIs">
             <list>
             	<value>static:(failover:(tcp://m0:5000,tcp://m1:5000))</value>
             </list>
         </property>		
	</bean>
</beans>

On starting it I got:

DEBUG - TCP consumer thread starting
DEBUG - Sending: WireFormatInfo { version=1, 
properties={TightEncodingEnabled=true, TcpNoDelayEnabled=true, 
SizePrefixDisabled=false, StackTraceEnabled=true, 
MaxInactivityDuration=30000, CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
DEBUG - Connection established
DEBUG - Received WireFormat: WireFormatInfo { version=1, 
properties={StackTraceEnabled=true, TightEncodingEnabled=true, 
TcpNoDelayEnabled=true, SizePrefixDisabled=false, 
MaxInactivityDuration=30000, CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
DEBUG - tcp://m0/192.168.46.100:5000 before negotiation: 
OpenWireFormat{version=1, cacheEnabled=false, stackTraceEnabled=false, 
tightEncodingEnabled=false, sizePrefixDisabled=false}
DEBUG - tcp://m0/192.168.46.100:5000 after negotiation: 
OpenWireFormat{version=1, cacheEnabled=true, stackTraceEnabled=true, 
tightEncodingEnabled=true, sizePrefixDisabled=false}
INFO - Network connection between vm://localhost#0 and tcp://m0:5000 
shutdown: Broker: localhost - Client: NC_localhost_outboundlocalhost 
already connected
javax.jms.InvalidClientIDException: Broker: localhost - Client: 
NC_localhost_outboundlocalhost already connected
         at 
org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:191)
         at 
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:73)
         at 
org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:69)
         at 
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:73)
         at 
org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:87)
         at 
org.apache.activemq.broker.AbstractConnection.processAddConnection(AbstractConnection.java:550)
         at 
org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:82)
         at 
org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:118)
         at 
org.apache.activemq.broker.AbstractConnection.service(AbstractConnection.java:226)
         at 
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:62)
         at 
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:91)
         at 
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
         at 
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:117)
         at 
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
         at 
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
         at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:127)
         at java.lang.Thread.run(Thread.java:595)
DEBUG -  stopping localhost bridge to localhost is disposed already ? false
INFO - Shutting down VM connectors for broker: localhost
INFO - Shutting down VM connectors for broker: localhost
INFO - Connector vm://localhost Stopped
DEBUG - Stopped.
DEBUG - localhost bridge to localhost stopped
ERROR - Failed to start network bridge: java.io.IOException: Transport 
disposed.
java.io.IOException: Transport disposed.
         at 
org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:69)
         at 
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:44)
         at 
org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:58)
         at 
org.apache.activemq.network.DemandForwardingBridgeSupport.startLocalBridge(DemandForwardingBridgeSupport.java:216)
         at 
org.apache.activemq.network.DemandForwardingBridgeSupport$3.run(DemandForwardingBridgeSupport.java:185)

What's wrong in my configuration?

--
Thanks,
Eugene Prokopiev


Mime
View raw message