Transfering more than just body from exchange to exchange

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Transfering more than just body from exchange to exchange

davsclaus
Administrator
Hi

I was improving the patches from George (CAMEL-383) to be able to virtually transfer a MinaExchange from one JVM to another JVM using camel.

The camel-mina component did only support transferring the body part.
So I had to inject a helper object that does the set the values on the exchange (MinaPayloadHelper). This has the side effect that this helper should always be used internally in camel-mina to set/get the values on exchange.
- 1) either body in/out as now
- 2) body in + out, header in + out, exchange properties + exception (MinaPayloadHolder)

My questions is:
a) Is there other parts in camel where a similar problem is resolved
b) Is there a more standard way of doing this in camel
c) Is #2 a feature we want to open up for in camel that is out-of-the-box
d) I tried to see if I could use other techniques such as DataFormat and a new codec. But they all have the same problem as camel-mina did set the values directly on the getOut().setBody(value) etc.
e) Should we transfer other parts of the exchange in #2 (I considered the exchange id, but I think it should be unique on each JVM instead of a copy from the previous exchange). There was no opening in the API to set the Fault.
f) The exchange have methods to copy from another exchange etc. Maybe we should have an API to copy from other sources such that are not an Exchange (as MinaPayloadHolder).


What are your thoughts?
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/