You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jim Talbut <jt...@spudsoft.co.uk> on 2011/07/08 07:50:39 UTC

Is there any way for a CXF interceptor to access the Camel Exchange?

Hi,

I want to log the "on the wire" data seen by CXF, which I can do with a 
CXF interceptor, but I want to be able to correlate that log with the 
state of the Camel Exchange at that point.
What I really want is a cross between a CXF interceptor and a Camel 
TraceEventHandler, but that's not possible (because the 
TraceEventHandler never gets to see the "on the wire" representation).
So is there any way for a CXF interceptor to access the Camel Exchange?
I was a bit surprised to find that it isn't recorded in the CXF 
INVOCATION_CONTEXT, but it isn't.

For inbound requests I could add a header in the CXF interceptor that 
Camel can pick up, but for outbound requests I'd need to do that 
automatically (I don't want to have to manually add an extra processor 
before every CXF node in the route).

Thanks

Jim

Re: Is there any way for a CXF interceptor to access the Camel Exchange?

Posted by Willem Jiang <wi...@gmail.com>.
Current CXF know nothing about the CXF. 
If you want to put the Camel Exchange into the CXF invocation-context, 
you may need to do some modification in the DefaultCxfBinding.
 
On Fri Jul  8 13:50:39 2011, Jim Talbut wrote:
> Hi,
> 
> I want to log the "on the wire" data seen by CXF, which I can do with a 
> CXF interceptor, but I want to be able to correlate that log with the 
> state of the Camel Exchange at that point.
> What I really want is a cross between a CXF interceptor and a Camel 
> TraceEventHandler, but that's not possible (because the 
> TraceEventHandler never gets to see the "on the wire" representation).
> So is there any way for a CXF interceptor to access the Camel Exchange?
> I was a bit surprised to find that it isn't recorded in the CXF 
> INVOCATION_CONTEXT, but it isn't.
> 
> For inbound requests I could add a header in the CXF interceptor that 
> Camel can pick up, but for outbound requests I'd need to do that 
> automatically (I don't want to have to manually add an extra processor 
> before every CXF node in the route).
> 
> Thanks
> 
> Jim



-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang