Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-13403

Default allowUseOriginalMessage="false" prevent clearing inflightRepository using jms with transferExchange="true"

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0-M3, 3.0.0
    • camel-jms
    • None
    • Unknown

    Description

      When using transferExchange="true" in a JMS consumer (assuming producer also did), camel is breaking the match between key and exchange in inflightRepository if allowUseOriginalMessage="true" is not set in camel context.

      This can lead to java heap space out of memory because camel is not able to clear the inflightRepository from old Exchange.

      Identified behaviour :

      1. Camel receive the JMS message
        1. If allowUseOriginalMessage=true : parse JMS message to build Exchange instance
        2. If not : generate a new Instance
      2. Camel add the Exchange to inflightRepository
      3. On accessing the ExchangeBody, if it was not parsed  yet camel rebuild the Exchange but do not change the key(exchangeId) in the inflightRepository
      4. When the route process is over the message is not disposed if the key has been changed in the Exchange but not inflightRepository
      5. Sooner or later the heap space if full and application crash.

      The problem appeared in 2.18.0 and is present up until 2.23.1 (tested with attached test case). Release note of 2.18.0 says :

      "Optimize Camel to only enable AllowUseOriginalMessage if in use by error handler or OnCompletion<http://camel.apache.org/oncompletion.html>. End user who manually access the original message using the Java API must configure AllowUseOriginalMessage=true."

      Problem is transferExchange="true" case also needs allowUseOriginalMessage="true" even if the not accessing original message by Java API an other way.

      Easy work around : set allowUseOriginalMessage="true" in camel context configuration

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            Bastien M Bastien Meert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment