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

Exchange formatter configured on Log Component may lead to incoherent results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.12.4, 2.13.2
    • 2.12.5, 2.13.3, 2.14.0
    • camel-core
    • None
    • Unknown

    Description

      Currently configuring a custom ExchangeFormatter at the Log Component level may lead to incoherent results if there are multiple Log endpoints in the context, with different log options (e.g. showBody=true, showBody=false).

      This is because the component looks up the ExchangeFormatter in the registry, sets its properties and then remembers the result for the subsequent endpoint initialisations. This is incorrect.

      The correct procedure is:

      1. Look up the ExchangeFormatter each time, obtaining a new fresh copy each time. This can be ensured by using @scope=prototype in Spring/Blueprint in the bean definition.
      2. Set its properties, according to the current endpoint's properties.
      3. Use the resulting ExchangeFormatter for that endpoint only.
      4. Subsequent endpoint initialisations must repeat the same procedure.

      Attachments

        Activity

          People

            raulvk Raúl Kripalani
            raulvk Raúl Kripalani
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: