Hi Beware the wire tap does not do a deep clone of the data, so you may have concurrent threads work on the same instance.
You can convert your data to a byte[] or String which would is immutable and would not have side effects etc. On Fri, May 30, 2014 at 10:54 AM, Stanisław Kuś <[email protected]> wrote: > Hi, > > recently I have experienced a nondeterministic problem while using wireTap > in my route (Camel 2.13.0). > > I assume that wireTap should be transparent to main Route proccessing ( > http://www.enterpriseintegrationpatterns.com/WireTap.html). > > from("direct:route1").routeId("route1") > .setExchangePattern(ExchangePattern.InOut).streamCaching() > .marshal().json(JsonLibrary.Jackson) > > .wireTap("direct:logIt").to("direct:httpsCall").wireTap("direct:logItAfter").... > > Wiretap Route: > > > from("direct:logIt").setExchangePattern(ExchangePattern.InOnly).streamCaching().convertBodyTo(String.class).to("file:serverCall/request?autoCreate=true"); > > > The problem appears as I try to call the route several times with the same > data - sometimes after wireTap the *body is null *causing errors on called > server. > > It's a bug in Camel or I'm doing something wrong? > > Thanks in advance for Your support, > > Best regards, > Stanislaw Kus -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
