Results 1 to 2 of 2

Thread: DefaultMessageListenerContainer with clustering

  1. #1
    Join Date
    Feb 2005
    Posts
    24

    Default DefaultMessageListenerContainer with clustering

    I am using two activemq servers and connecting to them from Spring using URL

    prod.USAmazon.JmsBrokerUrl="failover://(tcp://rspp-prod-na-0104.sea3.amazon.com:61616,tcp://rspp-prod-na-1007.vdc.amazon.com:61616?trace=false)?initialReco nnectDelay=100";


    and then registering listener as

    <bean class="org.springframework.jms.listener.DefaultMes sageListenerContainer" init-method="start" destroy-method="stop">
    <property name="connectionFactory" ref="staticJmsConnectionFactory"/>
    <property name="destination" ref="responseQueue"/>
    <property name="messageListener" ref="asyncResponseAdapter"/>
    <property name="concurrentConsumers" value="1"/>
    <property name="sessionTransacted" value="true"/>
    </bean>

    However, I am getting connected to only one of the server. If I increase concurrentConsumers to higher value, I see that I am connected to both, but is there a way to connect to both servers with only 1 consumer.

  2. #2

    Default No other way

    No, there is no other way, the concurrent consumers define the maximum number of consumers that can be created. Since you are not alowing more than one so the first server it is able to connect to, it is going to start listening to it. In case you are using queues then ideally you should eb listening with more consumers to fasten processing.

    One more pitfall though, even in case you define say 5 concurrent consumers and now you are listening to both the queues if one of the queues go down then all consumers will gte hooked on to the first server itslef. One needs to use application server setting such as forward messages to members of the same distributed queue to avoid such a situation

Posting Permissions

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