1

activemq 5.12

Network of broker configuration: hub, spoke1, spoke2

spoke1 has duplex n/w connection to hub spoke2 has duplex network connection to hub

I use the following to produce on spoke1

bin/activemq producer --brokerurl tcp://0.0.0.0:61616 --destination queue://producer-214 --messagecount 100 --message "hi there" Then on spoke2, I try to consume messages

bin/activemq consumer --brokerUrl tcp://0.0.0.0:61616 --destination queue://producer-214 I can see that 100 messages are enqueued on spoke1, but my consumer doesnt see any of the messages and just waits like so

INFO | Connecting to URL: tcp://0.0.0.0:61616 (null:null) INFO | Consuming queue://producer-214 INFO | Sleeping between receives 0 ms INFO | Running 1 parallel threads INFO | consumer-1 wait until 1000 messages are consumed My configuration for spoke1/2 is identical except for brokername. following is config for spoke2 :

http://www.springframework.org/schema/beans/spring-beans.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

file:${activemq.conf}/credentials.properties element is used to configure the ActiveMQ broker. -->

<destinationPolicy>
    <policyMap>
      <policyEntries>
        <policyEntry topic=">" >
            <!-- The constantPendingMessageLimitStrategy is used to prevent
                 slow topic consumers to block producers and affect other consumers
                 by limiting the number of messages that are retained
                 For more information, see:

                 http://activemq.apache.org/slow-consumer-handling.html

            -->
          <pendingMessageLimitStrategy>
            <constantPendingMessageLimitStrategy limit="1000"/>
          </pendingMessageLimitStrategy>
        </policyEntry>
      </policyEntries>
    </policyMap>
</destinationPolicy>

<networkConnectors>
    <networkConnector uri="static:(tcp://172.31.10.24:61616)?transport.useInactivityMonitor=false" duplex="true"/>
</networkConnectors>

<!--
    Configure message persistence for the broker. The default persistence
    mechanism is the KahaDB store (identified by the kahaDB tag).
    For more information, see:

    http://activemq.apache.org/persistence.html
-->
<persistenceAdapter>
    <kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter>


  <!--
    The systemUsage controls the maximum amount of space the broker will
    use before disabling caching and/or slowing down producers. For more information, see:
    http://activemq.apache.org/producer-flow-control.html
  -->
  <systemUsage>
    <systemUsage>
        <memoryUsage>
            <memoryUsage percentOfJvmHeap="70" />
        </memoryUsage>
        <storeUsage>
            <storeUsage limit="100 gb"/>
        </storeUsage>
        <tempUsage>
            <tempUsage limit="50 gb"/>
        </tempUsage>
    </systemUsage>
</systemUsage>
<transportConnectors>
    <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
    <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

<!-- destroy the spring context on shutdown to stop jetty -->
<shutdownHooks>
    <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
</shutdownHooks>

Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
-->
<import resource="jetty.xml"/>
</beans>

Any help will be appreciated

Regards

1

The issue was I had networkTTL=1 as soon as I made networkTTL=2 in the metwork connector, messages could be read from spoke2

Thank You

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.