Results 1 to 5 of 5

Thread: DefaultMessageListenerContainer and ConcurrentConsumers

  1. #1
    Join Date
    Jan 2006
    Location
    Southampton, UK
    Posts
    117

    Default DefaultMessageListenerContainer and ConcurrentConsumers

    Can anyone give me a quick rundown on what concurrentConsumers means in the context of the DefaultMessageListenerContainer. I started using it thinking that it would allow parallel execution of multiple messages, but it appears that it may just process the same indication multiple times. Is that the anticpated behavior, and if so, why would something like that be useful?

  2. #2
    Join Date
    Aug 2004
    Location
    Linz, Austria
    Posts
    391

    Default

    DefaultMessageListenerContainer essentially fires up a number of concurrent threads, each having one JMS consumer listening to the given destination. This should result in parallel processing of messages, without receiving the same message multiple times (unless you didn't acknowledge in CLIENT_ACKNOWLEDGE mode, or caused a transaction rollback).

    Are you experiencing any unexpected side effects when you increase the number of concurrent consumers?

    Juergen

  3. #3
    Join Date
    Jan 2006
    Location
    Southampton, UK
    Posts
    117

    Default

    I'm pretty sure that we're seeing multiple receives of the same message. However, I'm not yet sure about the CLIENT_ACKNOWLEDGE mode. I'll need to check the code again. Is that the default if I don't set anything explicitly?

  4. #4
    Join Date
    Aug 2004
    Location
    Linz, Austria
    Posts
    391

    Default

    The default is AUTO_ACKNOWLEDGE, or transactional reception (if a transaction manager has been specified).

    If you're actually seeing multiple receives of the same message, double-check the configuration of your JMS provider, since it then obviously dispatches the same message to multiple concurrent JMS Sessions.

    I assume we're talking about a queue here? Of course, for a topic, the JMS provider would naturally propagate a message to all registered subscribers with matching selector (that is, to each of the concurrent consumers)...

    Juergen

  5. #5
    Join Date
    Jan 2006
    Location
    Southampton, UK
    Posts
    117

    Default

    Of course it was the simplest thing possible. We just had a mashup of topics and queues and not everybody was assigned to what they actually needed. Some needed the throughput of multiple concurrent listeners while others needed multiple listeners for the same information. In the end we found a good solution making things listen on topics and queues as needed but made sure that the publishing destination (in the JmsTemplate) used an ActiveMQ composite destination.

    Thanks again for your help in this situation. I knew the problem was us and not in the Spring code; you almost never find bugs there after all.

Posting Permissions

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