camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <brad.john...@mediadriver.com>
Subject Re: camel seda queue log
Date Thu, 15 Sep 2016 14:36:52 GMT
Akram,

The fact that you are tokenizing to a String may make the shallow copy vs
deep copy less of a concern since String is immutable.  Normally.  But if
the Exchange itself is being shared and modifications to String resulting
in a new String and are shared via the Exchange then it is critical.  I'd
have to dig into the bowels of the code of the Exchange more to know. Claus
would definitely have a better grasp on that than I.

I noticed that you are outputting to a splunkstore and elasticsearchstore
and sort of assumed these were write operations without mutation of the
underlying data but obviously that may be a bad "assumption".

By the way, the WireTap has this same issue.  I've known folks to get into
trouble with that on occasion assuming that the WireTap made a clone of the
data when it is, in fact, shared.  Personally I think the message clone
would be more in keeping with the use case of a WireTap but forcing that
could be a performance headache.  That's especially true if you are just
using it to log or write out to a database for tracking purposes.

On Thu, Sep 15, 2016 at 1:03 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> Yes the multicast does a shallow copy so its the same reference.
>
> You can use onPrepareRef where you can write some code that performs a
> deep copy of the message.
> http://camel.apache.org/multicast
>
>
>
> On Wed, Sep 14, 2016 at 11:31 PM, Akram <akram.sa18@gmail.com> wrote:
> > I have tried using default queue mechanism. There also i am seeing the
> same
> > log "using shared queue". So trying to understand what it actually does
> > mean.
> >
> > Also I am sending same object to two different seda routes using
> multicast.
> > I wants to understand whether both routes use same object reference, as
> it
> > is using the shared queue.
> >
> > Here is my actual route.
> >
> > from("file://somefile")
> > .split(bodyAs(String.class).tokenize("\n"))
> > .multicast().to("seda:splunkstore","seda:elasticsearchstore");
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://camel.465427.n5.nabble.
> com/camel-seda-queue-log-tp5787556p5787559.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message