Results 1 to 2 of 2

Thread: jms-listener vs jms-source

Hybrid View

  1. #1

    Default jms-listener vs jms-source

    I need to be listening to a queue and I see that I can use either jms-source or jms-listener to do the same. Which should I be using ?
    What does jms-source offers above jms-listener and vice-versa ?

    Also, I noticed that when I used jms-source to read the messages from the queue, the queue still retained the message (did not flush).
    While in jms-listener the queue empties as the message is read/processed . Is there any particular implementation detail that Im missing here ?
    Last edited by diippi; Feb 13th, 2008 at 12:39 PM. Reason: Addendum

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,844

    Default

    The <jms-source> element can create one of two types of source adapters: JmsPollingSourceAdapter (if the 'poll-period' is provided) or JmsMessageDrivenSourceAdapter (if the 'poll-period' is not provided). The latter will create and delegate to an instance of DefaultMessageListenerContainer. In that sense, it is essentially the same behavior as a directly configured <jms-listener>. The key difference of course is that the Spring Integration source adapters will convert the JMS Message to a generic Message and send it to a MessageChannel. The behavior that you are seeing with the JMS Message on the queue is due to the fact that the JmsMessageDrivenSourceAdapter sets 'sessionTransacted' to TRUE on the underlying DefaultMessageListenerContainer. The normal default value is FALSE.

    -Mark

Posting Permissions

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