Camel message headers getting lost when calling IN_OUT method on SwitchYard Bean service

Solution Verified - Updated -

Issue

  • We have a problem with Camel message headers getting lost when calling an IN_OUT method on a SwitchYard Bean service in a Camel route.
  • Here is the relevant section in our Camel route:
.log("BEFORE: ${header.some_id}")
.to("switchyard://MyService?operationName=doSomething")
.log("AFTER: ${header.some_id}")
  • And here is the interface of the service:
public interface MyService {
  Object doSomething(SomeObject parameter);
}
  • Before calling doSomething the header ${header.some_id} is available, but after the call it is gone.
  • It is only broken if the MEP of the method is IN_OUT. If I change the above method to have a void return type, then everything works fine. E.g.:
  void doSomething(SomeObject parameter);
  • Which leads me to believe that under the hood SwitchYard is at some point calling .getOut() when setting the body, which causes a new message to created and all headers get lost.
  • How can we fix this somehow and preserve the headers when calling an IN_OUT SwitchYard service method in a Camel route?

  • There is a SwitchYard project which contain a Camel(XML) component. In this component users set the header to specific value and then call a SwitchYard service (bean). After calling the SwitchYard service (bean) user prints the header inside the same application flow and it surprisingly found empty. It seems that SwitchYard loses the header after calling SwitchYard service (bean). How can users save information without loosing the header when calling SwitchYard service (bean) ?

Environment

  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content