git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

no consumers for the queue by a duplex network connector


activemq version: 5.14.0 
jdk version: 1.7.0_67

architecture: 
Broker cluster A(a 3 instances activemq cluster use jdbc lock with mysql
backend) and Broker B cluster(a 3 instances  cluster use jdbc lock with
mysql backend).
Broker B config a duplex network connector to Broker A. Producer produce
messages into brokerA, consumers consume messages from broke B, bridge queue
like queueA,queueB 
Also there are to more cluster connect to Broker A with a same network
connector like BrokerB

networkConnector config in Broker B (this is the compeletely config in the
real environment, no any other extra configuration): 
<networkConnectors> 
            <networkConnector 
uri="masterslave:(tcp://172.16.202.62:61616,tcp://172.16.202.65:61616,tcp://172.16.202.68:61616)" 
duplex="true" name="bridge_111"></networkConnector> 
</networkConnectors> 

problem: 
early this morning, brokeB happened a faileover event, and the master
changed. the pre-master Broker B1 lost the jdbc lock. and broker B2 in the
broke B cluster, successfuly became the master, and established the network
connection to broker A. 
And then, the problem happened. producer can produce messages to Broker A,
but consumers cannot consumer messages from brokeB by the same queue.

process: 
1、as the log shows, the network bridge has successfully been established。and
there  are no other error logs info. 
2、I found that, when consumer connect to broker B to consume queueA, in
broke A, there is no consumers for queueA.Normally, here should be a network
bridge consumer to brokeA.
3、restart the broke A and broke B,the problem happened as same 
4、when the problem happened,Iuse jconsole to see the  jmx info. I can see
that there certainly was no consumer of the Broker A,and there was no topic
name like "ActiveMQ.Advisory.Consumer.Queue.queueA" for the bridge queue
queueA.
5、I try to use static bridge for testing, and when static bridge was
configed fo the queueA,the problem disappeared.So it seam like the advisory
topic's problem, as I know that bridge need adbisory topic and message.

resole solution:
shutdown all the instances of broker cluster A,and broker cluster B.and then
start a instance of broker cluster A, then start a instance of broker
cluster B.
By these steps, the network bridge back to normal,and the bridge-queue has
the consumers.

this problem happened very often recently, once fail-over happened,it
happened, and I have to use the above steps to recovery the cluster.




the activemq.xml :


<beans
  xmlns="http://www.springframework.org/schema/beans";
xmlns:amq="http://activemq.apache.org/schema/core";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
  http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd
 http://activemq.apache.org/camel/schema/spring 
 http://activemq.apache.org/camel/schema/spring/camel-spring.xsd";>

    
    <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.conf}/credentials.properties</value>
        </property>
    </bean>

   
    <bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"
          lazy-init="false" scope="singleton"
          init-method="start" destroy-method="stop">
    </bean>
    
    
  <bean id="mysql-ds" class="org.apache.commons.dbcp2.BasicDataSource"
destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url"
value="jdbc:mysql://*****.com:5011/activemq?relaxAutoCommit=true"/>
    <property name="username" value="****"/>
    <property name="password" value="****"/>
    <property name="initialSize" value="10" />
  
    <property name="maxIdle" value="10" />
    <property name="minIdle" value="100" />
    <property name="validationQuery" value="select 1" />
    <property name="poolPreparedStatements" value="true"/>
  </bean>   

    
    <broker xmlns="http://activemq.apache.org/schema/core";
brokerName="bj_172.20.32.110" dataDirectory="${activemq.data}">

        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" >
                    
                  <pendingMessageLimitStrategy>
                    <constantPendingMessageLimitStrategy limit="8000"/>
                  </pendingMessageLimitStrategy>
                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy>
         
       <networkConnectors>
<networkConnector
uri="masterslave:(tcp://172.16.202.62:61616,tcp://172.16.202.65:61616,tcp://172.16.202.68:61616)"
duplex="true"
  name="nj_to_bj_110"
>
</networkConnector>
</networkConnectors>

        
        <managementContext>
            <managementContext createConnector="true"/>
        </managementContext>

        
        <persistenceAdapter>
               <jdbcPersistenceAdapter dataDirectory="activemq-data" 
dataSource="#mysql-ds"/>
        
        </persistenceAdapter>


          
          <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage percentOfJvmHeap="70" />
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="100 gb"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="50 gb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>

        
        <transportConnectors>
            
                <transportConnector name="openwire"
uri="tcp://0.0.0.0:61616?maximumConnections=8000&amp;wireFormat.maxFrameSize=2104857600"/>
            <transportConnector name="amqp"
uri="amqp://0.0.0.0:5672?maximumConnections=8000&amp;wireFormat.maxFrameSize=2104857600"/>
            <transportConnector name="stomp"
uri="stomp://0.0.0.0:61613?maximumConnections=8000&amp;wireFormat.maxFrameSize=2104857600"/>
            <transportConnector name="mqtt"
uri="mqtt://0.0.0.0:1883?maximumConnections=8000&amp;wireFormat.maxFrameSize=2104857600"/>
            <transportConnector name="ws"
uri="ws://0.0.0.0:61614?maximumConnections=8000&amp;wireFormat.maxFrameSize=2104857600"/>
        </transportConnectors>

        
        <shutdownHooks>
            <bean xmlns="http://www.springframework.org/schema/beans";
class="org.apache.activemq.hooks.SpringContextHook" />
        </shutdownHooks>

    </broker>

    
    <import resource="jetty.xml"/>

</beans>





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