Announcement Announcement Module
Collapse
No announcement yet.
Unexpected behaviour with JMS listener container Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unexpected behaviour with JMS listener container

    I'm using a JMS listener container to call a method on a singleton service-type bean. Since I configured the concurrency to be 1, I expected the service not to be called by several threads in parallel. However, that's what's happening.

    Code:
    <jms:listener-container 
      container-type="simple" 
      destination-type="queue" 
      connection-factory="connectionFactory"  
      message-converter="myMessageConverter" 
      concurrency="1" 
      acknowledge="transacted" 
      cache="connection">
        <jms:listener 
          destination="myQueue" 
          ref="myService" 
          method="myMethod"/>
    </jms:listener-container>
    I tried the simple and default message listener container with identical results. I also made sure there's only one message listener container instantiated in my application context.

    Any help would be greatly appreciated.

    Cheers,
    Dan

  • #2
    Have you tried configuring the listener the old way, without using jms namespaces? Maybe there's a problem in how concurrency is being mapped.

    Comment


    • #3
      The underlying problem was a misconfiguration of the application context. One XML context file was included in 2 other XML context files. This did not immediately create problems for beans with explicit IDs (the later definition simply overwrites the former), but the JMS namespace happily created 2 separate listener container beans that both called my service-type bean in parallel.

      By configuring the listener the old way, the problem would have gone away (explicit ID). Anyway, I'm glad I found the underlying misconfiguration issue. Thanks for your suggestion, natephipps!

      Cheers,
      Dan

      Comment

      Working...
      X