activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TC <thiam.che...@gmail.com>
Subject ActiveMQ network bridges disconnect frequently with topic
Date Mon, 18 Feb 2019 09:56:41 GMT
Hi, 

I have a set of brokers setup with failover configuration as follows:

roker A ---> (failover) --> Broker B1 or Broker B2

Application connected to Broker A send event messages via topic, i.e.
MyEventTopic. 

Snapshot of key activemq Broker A configuration 
------------------------------------------------------------------------------
<broker xmlns="http://activemq.apache.org/schema/core" 
      brokerName="BrokerA" 
      dataDirectory="${activemq.data}" 
      useJmx="true" 
      useVirtualDestSubs="true" 
      useVirtualDestSubsOnCreation="true">


<networkConnectors>

   <networkConnector name="ToB1orToB2" 
     duplex="false" 
     userName="abc" 
     password="cdef" prefetchSize="50000" networkTTL="5" 
   
uri="masterslave:(tcp://B1Broker:61616,tcp://B2Broker.hq.tnb.com.my:61616)" 
    useVirtualDestSubs="true">
		

       <dynamicallyIncludedDestinations>	

          <topic physicalName="MyEventTopic"/>  
				           </dynamicallyIncludedDestinations>
	
   </networkConnector>

   another network connector for Queue using DynamicallyIncludedDestinations
as well 
</networkConnectors>
---------------------------------------------------------------------------------------------

So, on Broker A ActiveMQ web console, I could see 2 network bridges. One for
the queue and the other for the topic. 

The queue related network connector works fine. 

However, the topic related network bridges seem to drop (i.e. the connection
drop) 
and sometimes, when the connection drop, the message enqueue and dequeued
are not the same. Suspect messages are lost. 

The error from ActiveMQ logs: 
------------------------------------------------------------------------------------------------------------
2019-02-12 18:35:55,028 | INFO  | Network connection between
vm://localhost#34232 and tcp://BrokerB1:61616 shutdown due to a local error:
{} | org.apache.activemq.network.DemandForwardingBridgeSupport | ActiveMQ
Transport: tcp://BrokerB1/BrokerA:61616@48226
java.util.concurrent.CancellationException
	at java.util.concurrent.FutureTask.report(FutureTask.java:121)[:1.8.0_131]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)[:1.8.0_131]
	at
org.apache.activemq.broker.region.cursors.AbstractStoreCursor.gotToTheStore(AbstractStoreCursor.java:137)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.cursors.AbstractStoreCursor.recoverMessage(AbstractStoreCursor.java:124)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.cursors.AbstractStoreCursor.tryAddMessageLast(AbstractStoreCursor.java:237)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor.addMessageLast(AbstractPendingMessageCursor.java:93)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.cursors.StoreQueueCursor.tryAddMessageLast(StoreQueueCursor.java:104)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor.addMessageLast(AbstractPendingMessageCursor.java:93)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.Queue.doPendingCursorAdditions(Queue.java:770)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.Queue.tryOrderedCursorAdd(Queue.java:875)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.Queue.doMessageSend(Queue.java:854)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.Queue.send(Queue.java:725)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:505)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:468)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.jmx.ManagedRegionBroker.send(ManagedRegionBroker.java:293)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.virtual.CompositeDestinationFilter.doForward(CompositeDestinationFilter.java:120)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.virtual.CompositeDestinationFilter.send(CompositeDestinationFilter.java:100)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:505)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:468)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.jmx.ManagedRegionBroker.send(ManagedRegionBroker.java:293)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:153)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:96)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:293)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:158)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:581)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:768)[activemq-client-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:336)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:200)[activemq-broker-5.15.2.jar:5.15.2]
	at
org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)[activemq-client-5.15.2.jar:5.15.2]
	at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:125)[activemq-client-5.15.2.jar:5.15.2]
	at
org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:301)[activemq-client-5.15.2.jar:5.15.2]
	at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)[activemq-client-5.15.2.jar:5.15.2]
	at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:233)[activemq-client-5.15.2.jar:5.15.2]
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)[activemq-client-5.15.2.jar:5.15.2]
	at java.lang.Thread.run(Thread.java:748)[:1.8.0_131] 
----------------------------------------------------------------------------------------------------------

At Broker B1 or B2 :

The activemq configuration is as follows: 
----------------------------------------------------------------------
1. use VirtualDestStubs
   <broker xmlns="http://activemq.apache.org/schema/core"
brokerName="BrokerB1" dataDirectory="${activemq.data}"
useVirtualDestSubs="true" useVirtualDestSubsOnCreation="true">
2. use destinationInterceptor to forward topic to 2 queues.

           <compositeTopic name="MyEventTopic">
              <forwardTo>
                  <queue physicalName="MyEventQueue1" />
                  <queue physicalName="MyEventQueue2" />
              </forwardTo>
           </compositeTopic>

3. I see lots of duplicate message for MyEventQueue1 an MyEventQueue2

Question: 
1. What is the possible causes for the frequent network bridge connection
drops, and how do I avoid duplicate queue messages at Broker B1 or B2 ? 

Thanks

-TC



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Mime
View raw message