Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-287

zeroconfDiscovery fails to restore disconnect channel

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.1
    • Broker
    • None

    Description

      Per Christopher Kingsbury:

      Hi Ramzi,

      I just tested against the latest in SVN, and it seems to have fixed the 80 megs of log messages. However, the brokers don't seem to reconnect properly. Here is how I was able to reproduce this problem.

      1. Remove all contents of the var directories in alpha and beta
      2. Startup Alpha, and wait until it logs "ActiveMQ JMS Message Broker (alpha) has started"
      3. Startup Beta, and wait until it logs "Started NetworkChannel to tcp://localhost:61616"
      4. Startup example consumer, pointed to alpha "ant consumer -Durl=tcp://localhost:61616"
      5. Startup producer, pointed at beta "ant producer -Durl= tcp://localhost:61617". Messages are successfully delivered
      6. Kill beta via kill command
      7. Restart beta, and wait for "Started NetworkChannel to tcp://localhost:61616"
      8. Startup example consumer, pointed to alpha. It doesn't log any, however the Alpha broker then logs the following error

      00:57:20 ERROR Failed to start NetworkMessageBridge for destination: TEST.FOO
      org.activemq.ConnectionClosedException: The connection is already closed
      at org.activemq.ActiveMQConnection.checkClosed(ActiveMQConnection.java:811)
      at org.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:446)
      at org.activemq.transport.NetworkChannel.createBridge(NetworkChannel.java:416)
      at org.activemq.transport.NetworkChannel.addConsumerInfo(NetworkChannel.java:385)
      at org.activemq.transport.NetworkChannel.addConsumerInfo(NetworkChannel.java:379)
      at org.activemq.transport.NetworkChannel.access$200(NetworkChannel.java:53)
      at org.activemq.transport.NetworkChannel$2.run(NetworkChannel.java:237)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:595)

      9. Startup example producer, pointed to beta. Messages are not delivered to the consumer

      Interesting thing is that if I kill and restart alpha instead of beta (in the both test case), the producer/consumer works fine after the restart. I've attached the logfiles and config files.

      Thanks for your help.
      Chris

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//ACTIVEMQ//DTD//EN" "http://activemq.org/dtd/activemq.dtd">
      <beans>

      <!-- ==================================================================== -->
      <!-- ActiveMQ Broker Configuration -->
      <!-- ==================================================================== -->
      <broker name="alpha">
      <connector>
      <tcpServerTransport uri="tcp://localhost:61616" backlog="1000" useAsyncSend="true" maxOutstandingMessages="50"/>
      </connector>

      <discoveryAgent>
      <zeroconfDiscovery type="_activemq.broker.development."/>
      </discoveryAgent>
      <discoveryNetworkConnector/>

      <persistence>
      <cachePersistence>
      <journalPersistence directory="../var/journal">
      <jdbcPersistence dataSourceRef="derby-ds"/>

      <!-- Choose one of the following three configurationss to work with mysql-ds-->
      <!--
      <jdbcPersistence dataSourceRef="mysql-ds"
      adapterClass="org.activemq.store.jdbc.adapter.BytesJDBCAdaptor"/>
      <jdbcPersistence dataSourceRef="mysql-ds"
      adapterClass="org.activemq.store.jdbc.adapter.BlobJDBCAdaptor"/>
      <jdbcPersistence dataSourceRef="mysql-ds"
      adapterClass="org.activemq.store.jdbc.adapter.StreamJDBCAdaptor"/>
      -->
      </journalPersistence>
      </cachePersistence>
      </persistence>
      </broker>

      <!-- ==================================================================== -->
      <!-- JDBC DataSource Configurations -->
      <!-- ==================================================================== -->

      <!-- The Derby Datasource that will be used by the Broker -->
      <bean id="derby-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName">
      <value>org.apache.derby.jdbc.EmbeddedDriver</value>
      </property>
      <property name="url">
      <!-- Use a URL like 'jdbc:hsqldb:hsql://localhost:9001' if you want to connect to a remote hsqldb -->
      <value>jdbc:derby:derbydb;create=true</value>
      </property>
      <property name="username">
      <value></value>
      </property>
      <property name="password">
      <value></value>
      </property>
      <property name="poolPreparedStatements">
      <value>true</value>
      </property>
      </bean>

      <!-- The MYSQL Datasource that will be used by the Broker -->
      <bean id="mysql-ds"
      class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close">
      <property name="driverClassName">
      <value>com.mysql.jdbc.Driver</value>
      </property>
      <property name="url">
      <value>jdbc:mysql://localhost/activemq</value>
      </property>
      <property name="username">
      <value>myname</value>
      </property>
      <property name="password">
      <value>mypassword</value>
      </property>
      <property name="poolPreparedStatements">
      <value>true</value>
      </property>
      </bean>

      </beans>

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//ACTIVEMQ//DTD//EN" "http://activemq.org/dtd/activemq.dtd">
      <beans>

      <!-- ==================================================================== -->
      <!-- ActiveMQ Broker Configuration -->
      <!-- ==================================================================== -->
      <broker name="beta">
      <connector>
      <tcpServerTransport uri="tcp://localhost:61617" backlog="1000" useAsyncSend="true" maxOutstandingMessages="50"/>
      </connector>

      <discoveryAgent>
      <zeroconfDiscovery type="_activemq.broker.development."/>
      </discoveryAgent>
      <discoveryNetworkConnector/>

      <persistence>
      <cachePersistence>
      <journalPersistence directory="../var/journal">
      <jdbcPersistence dataSourceRef="derby-ds"/>

      <!-- Choose one of the following three configurationss to work with mysql-ds-->
      <!--
      <jdbcPersistence dataSourceRef="mysql-ds"
      adapterClass="org.activemq.store.jdbc.adapter.BytesJDBCAdaptor"/>
      <jdbcPersistence dataSourceRef="mysql-ds"
      adapterClass="org.activemq.store.jdbc.adapter.BlobJDBCAdaptor"/>
      <jdbcPersistence dataSourceRef="mysql-ds"
      adapterClass="org.activemq.store.jdbc.adapter.StreamJDBCAdaptor"/>
      -->
      </journalPersistence>
      </cachePersistence>
      </persistence>
      </broker>

      <!-- ==================================================================== -->
      <!-- JDBC DataSource Configurations -->
      <!-- ==================================================================== -->

      <!-- The Derby Datasource that will be used by the Broker -->
      <bean id="derby-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName">
      <value>org.apache.derby.jdbc.EmbeddedDriver</value>
      </property>
      <property name="url">
      <!-- Use a URL like 'jdbc:hsqldb:hsql://localhost:9001' if you want to connect to a remote hsqldb -->
      <value>jdbc:derby:derbydb;create=true</value>
      </property>
      <property name="username">
      <value></value>
      </property>
      <property name="password">
      <value></value>
      </property>
      <property name="poolPreparedStatements">
      <value>true</value>
      </property>
      </bean>

      <!-- The MYSQL Datasource that will be used by the Broker -->
      <bean id="mysql-ds"
      class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close">
      <property name="driverClassName">
      <value>com.mysql.jdbc.Driver</value>
      </property>
      <property name="url">
      <value>jdbc:mysql://localhost/activemq</value>
      </property>
      <property name="username">
      <value>myname</value>
      </property>
      <property name="password">
      <value>mypassword</value>
      </property>
      <property name="poolPreparedStatements">
      <value>true</value>
      </property>
      </bean>

      </beans>

      Attachments

        Activity

          People

            rsaba Ramzi Saba
            rsaba Ramzi Saba
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: