smooks / smooks-camel-cartridge

Smooks Camel Cartridge
https://www.smooks.org/documentation/#apache_camel
Other
1 stars 1 forks source link

Copy Message Headers #70

Open jeffgbradley2 opened 3 years ago

jeffgbradley2 commented 3 years ago

When using the Camel Smooks component to split and route fragments of the translated data, the headers of the original Message are lost. It would be useful to have an option on the Smooks endpoint to copy the Message headers to the new Message.

Below is an example Smooks endpoint in the Camel XML route:

<to uri="smooks:smooks-config.xml"/>

Within the Smooks configuration file:

    <camel:route beanId="order" routeOnElement="orderItem">
        <camel:to endpoint="direct:order-item" />
    </camel:route>
jeffgbradley2 commented 3 years ago

After reviewing the SmooksProcessor and the BeanRouter, it appears that the intent is to pass the original message headers with the new messages that the component creates. The BeanRouter sends all beans in the context as message headers. Updating the SmooksProcessor to add a bean to the context with the original message headers will resolve the issue.