You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Stanisław Kuś <st...@gmail.com> on 2014/05/30 10:54:48 UTC

WireTap Problem

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

Re: WireTap Problem

Posted by Stanisław Kuś <st...@gmail.com>.
Nevertheless with String is working so far - so my Route must change the
stream somehow.

Thanks a lot for support !

Best regards,

Stanislaw



On Fri, May 30, 2014 at 2:01 PM, Stanisław Kuś <st...@gmail.com> wrote:

> Hi,
>
> I send json in form of String with streamCacheing enabled - since both
> Threads only read from stream and it's cached it shouldn't be a problem or
> I'm wrong?
>
> Best,
> Stanislaw
>
>
>
> On Fri, May 30, 2014 at 11:09 AM, Claus Ibsen <cl...@gmail.com>
> wrote:
>
>> 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ś <st...@gmail.com>
>> 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: cibsen@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>> hawtio: http://hawt.io/
>> fabric8: http://fabric8.io/
>>
>
>

Re: WireTap Problem

Posted by Stanisław Kuś <st...@gmail.com>.
Hi,

I send json in form of String with streamCacheing enabled - since both
Threads only read from stream and it's cached it shouldn't be a problem or
I'm wrong?

Best,
Stanislaw



On Fri, May 30, 2014 at 11:09 AM, Claus Ibsen <cl...@gmail.com> wrote:

> 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ś <st...@gmail.com>
> 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: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>

Re: WireTap Problem

Posted by Claus Ibsen <cl...@gmail.com>.
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ś <st...@gmail.com> 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: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/