Results 1 to 4 of 4

Thread: Multiple listeners in same listener container causing "Client: X already connected"

  1. #1

    Default Multiple listeners in same listener container causing "Client: X already connected"

    I get the following errors if I put multiple listeners in a single container:
    Code:
    Could not refresh JMS Connection for destination 'config/errors' - retrying in 5000 ms. Cause: Broker: localhost - Client: config-web already connected from /127.0.0.1:42384
    Could not refresh JMS Connection for destination 'config' - retrying in 5000 ms. Cause: Broker: localhost - Client: config-web already connected from /127.0.0.1:42384
    Spring 2.5.6 config:
    Code:
        <!-- Listeners -->
        <jms:listener-container connection-factory="jmsCF" acknowledge="client" client-id="config-web" destination-type="durableTopic" container-type="default">
            <jms:listener destination="config" subscription="CustomerIdUpdater" ref="CustomerIdUpdater"/>
            <jms:listener destination="config/errors" subscription="ErrorListener" ref="ErrorListener"/>
    
            <jms:listener destination="config" subscription="HeartbeatListener" ref="HeartbeatListener"/>
        </jms:listener-container>
    My MQ server is ActiveMQ 5.2.0, the broker bean's config is:

    Code:
        <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data">
    
            <!-- Destination specific policies using destination names or wildcards -->
            <destinationPolicy>
                <policyMap>
                    <policyEntries>
                        <policyEntry queue=">" memoryLimit="5mb"/>
                        <policyEntry topic=">" memoryLimit="5mb">
                            <dispatchPolicy>
                                <strictOrderDispatchPolicy/>
                            </dispatchPolicy>
                            <subscriptionRecoveryPolicy>
                                <lastImageSubscriptionRecoveryPolicy/>
                            </subscriptionRecoveryPolicy>
                        </policyEntry>
                    </policyEntries>
                </policyMap>
            </destinationPolicy>
    
            <!-- Do not create a JMX connector -->
            <managementContext>
                <managementContext createConnector="false"/>
            </managementContext>
    
            <!-- Journaled JDBC-based persistence adapter
               - Note that with this method, active-active brokers can't be used.
               - For more info see: http://activemq.apache.org/persistence.html
            <persistenceAdapter>
                <journaledJDBC dataDirectory="${activemq.base}/data" dataSource="#mysql-ds"/>
            </persistenceAdapter>
             -->
    
            <!--  The maximum about of space the broker will use before slowing down producers -->
            <systemUsage>
                <systemUsage>
                    <memoryUsage>
                        <memoryUsage limit="20 mb"/>
                    </memoryUsage>
                    <storeUsage>
                        <storeUsage limit="1 gb" name="foo"/>
                    </storeUsage>
                    <tempUsage>
                        <tempUsage limit="100 mb"/>
                    </tempUsage>
                </systemUsage>
            </systemUsage>
    
    
            <!-- The transport connectors ActiveMQ will listen to -->
            <transportConnectors>
                <transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
                <!--
                    <transportConnector name="ssl" uri="ssl://localhost:61617"/>
                -->
                <transportConnector name="stomp" uri="stomp://localhost:61613"/>
                <transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
            </transportConnectors>
    
        </broker>
    There doesn't seem to be a lot on Google about this, but multiple listeners on a single container are in the documentation's examples. Any thoughts as to what's going on here?

  2. #2

    Default

    Does anyone have any insight as to why this might be happening? I'll be happy to provide whatever additional information I can.

    Thanks.

  3. #3

    Default

    Hi,

    I have the same problem, do you mind share your solution

    Thanks,

  4. #4

    Default

    Unfortunately, I never found an ideal solution. Ultimately, I ended up creating a single listener that did it all.

    Code:
    <jms:listener-container connection-factory="jmsCF" acknowledge="client" client-id="cdn-config-web" destination-type="durableTopic">
    <jms:listener destination="cdn/config" subscription="ResponseListener" ref="ResponseListener" selector="JMSType = 'Response'"/>
    </jms:listener-container>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •