Spring Framework
  1. Spring Framework
  2. SPR-4590

MessageListenerAdapter is too eager when adapting (SessionAware)MessageListeners

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.2
    • Fix Version/s: 2.5.3
    • Component/s: JMS
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      When using the jms namespace to configure a message-listener container, a MessageListenerAdapter is created for each configured listener, including (SessionAware)MessageListeners. In the onMessage() method of the adapter, the message is converted to an object using a MessageConverter. This works fine for Text, Map, and ObjectMessages, but not for BytesMessages, which only provide streaming access to the contents.

      Thus, when a messagelistener wants to read the bytes stream from the message, the message payload has already been read, resulting in MessageEOFExceptions.

      The fix would be to check whether the delegate is a (SessionAware)MessageListener first, and only if it's not do the conversion.

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Juergen Hoeller
              Reporter:
              Arjen Poutsma
              Last updater:
              Trevor Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 5 weeks, 5 days ago