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:// --destination queue://producer-214 --messagecount 100 --message "hi there" Then on spoke2, I try to consume messages

bin/activemq consumer --brokerUrl tcp:// --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:// (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. -->

        <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:


            <constantPendingMessageLimitStrategy limit="1000"/>

    <networkConnector uri="static:(tcp://" duplex="true"/>

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

    <kahaDB directory="${activemq.data}/kahadb"/>

    The systemUsage controls the maximum amount of space the broker will
    use before disabling caching and/or slowing down producers. For more information, see:
            <memoryUsage percentOfJvmHeap="70" />
            <storeUsage limit="100 gb"/>
            <tempUsage limit="50 gb"/>
    <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
    <transportConnector name="openwire" uri="tcp://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="amqp" uri="amqp://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="stomp" uri="stomp://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="mqtt" uri="mqtt://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="ws" uri="ws://;wireFormat.maxFrameSize=104857600"/>

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

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

Any help will be appreciated



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.