camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: [Best Practise Question] Seda + WireTap + Exchange ID : How to keep it all together?!
Date Fri, 31 May 2013 12:55:04 GMT

When you use wire tap then the tapped exchange has its own unique exchange id.
But the wire tap will store the exchange id from its parent as a
"correlated exchange id".

You can get this id using java code:

String corId = exchange.getProperty(Exchange.CORRELATION_ID, String.class);

An alternative is to use the breadcrumbId which would be the same for
the original message and the wire tapped message.
You can read a bit here about that:

On Thu, May 30, 2013 at 8:23 PM, jamesilicious <> wrote:
> I've recently introduced Camel into a commercial project as a
> proof-of-concept to see if we can use the framework. So far I'm really
> enjoying Camel, and the community seems great. So enough gushing, whats my
> question!
> Scenario:
> * We have a file route that is polling a directory
> * When it finds a file, it makes an entry into a database
> * The route then hands off to a seda endpoint to do the rest of the
> processing
> * The seda endpoint also does some database inserts through a wiretap
> Problem
> * We need a key to link together the database entries made by the file
> route, and the seda route
> * Initially we tried using the exchange id, but noticed that it changes when
> seda picks up the request
> Question
> Is there a way of having the same exchange id when this hits the seda route?
> The exchange Id is going to be used as a primary key (and FK).
> I'd thought about taking the exchange id from the first route and adding it
> as a header to avoid it disappearing when passed to seda, but wanted a more
> elegant solution if possible. The seda route also has a couple of wireTaps
> that need to original exchange id too.
> Any thoughts?
> Thanks in advance
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
----------------- The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message