If just the damn Exchange was final so we had one implementation of it. But I guess we have to thank Java generics for that so the first API had generics for per component.
Could you create a ticket in JIRA for this?
As a workaround you can add a processor where you have full access to the Exchange so you can set a CxfMessage as the payload.
Thanks for the sanity check! I'll raise an issue on this.
Unfortunately, the workaround you suggest - adding a processor after the JMS producer - won't work This is because it is the pipeline processor, executing after the JMS producer and before the next processor in the pipeline, is the one calling getOut() and throwing the exception.
I'm going to look at putting in an interceptor around the JMS piece for now... watch this space, I'll let you know how I get on.
Can you try to use the Camel 2.0 ? In Camel 2.0 we remove the CXFExchange and CXFMessage when clean up the generic parameter of Exchange, so you will not get the ClassCastException any more.
I will try to find a way to fix this issue in Camel 1.x branch.
I committed a quick fix to the Apache Camel 1.x branch , also verified that this issue was fixed in Camel 2.0.
Here is the Apache Camel JIRA which trace this issue.