Raúl Kripalani created CAMEL-7798:
-------------------------------------
Summary: Exchange formatter configured on Log Component may lead
to incoherent results
Key: CAMEL-7798
URL: https://issues.apache.org/jira/browse/CAMEL-7798
Project: Camel
Issue Type: Bug
Components: camel-core
Affects Versions: 2.13.2, 2.12.4
Reporter: Raúl Kripalani
Assignee: Raúl Kripalani
Fix For: 2.12.5, 2.13.3, 2.14.0
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:
# 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.
# Set its properties, according to the current endpoint's properties.
# Use the resulting ExchangeFormatter for that endpoint only.
# Subsequent endpoint initialisations must repeat the same procedure.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)