Search code examples
javaapache-camelcxfjbossfuse

How to get camel exchange in cxf interceptor


I want to get the exchange body in cxf interceptor and make it as a camel exchange property. So that I can use this property in any processor or bean methods. I tried to get exchange with message.getExchange() but it will return a cxf exchange. How can I use the org.apache.cxf.message.Message to get the org.apache.camel.Exchange.


Solution

  • Perhaps you cannot do it exact that way because CXF interceptors are beyond Camel and have no idea about Camel. Camel Exchange is above CXF. But if you need to do exact what you said:

    get the exchange body ... and make it as a camel exchange property

    What does prevent you from doing that in the processor at very first step in Camel route? Why do you try to do that in CXF Interceptor?