camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anton_nazarov <naza...@telkom.co.za>
Subject transferring a data wrapper-object along the route
Date Thu, 03 Nov 2011 07:51:43 GMT
Hi,

I've got quite a long route which consists of 5-6 handler/to's clauses.
Starting from the first handler I create a data transfer object (some
business transaction specific info) which I populate with additional
information on every step. In the end of the route I serialize that object,
using JPA. I can't use body, since body is been used to transfer the
business process- specific messages.

Currently, I use exchange.setProperty() to store that object:
        BusinessTransaction transaction = prepareTransactionObject(keys,
messagePayload);
        exchange.setProperty(BusinessTransaction.TRANSACTION_PROPERTY,
transaction);

In every sequential handler I extract the BusinessTransaction object from
the Exchange property:    
exchange.getProperty(BusinessTransaction.TRANSACTION_PROPERTY,
BusinessTransaction.class);

... and populate is with new information. 

Question:
Is that way safe (e.g. thread safe), or, perhaps, there are other
recommendations (using headers, for example) to transfer accompanying
information along the long route?

Thanks,

Anton

--
View this message in context: http://camel.465427.n5.nabble.com/transferring-a-data-wrapper-object-along-the-route-tp4960377p4960377.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message