Maybe it's a good aidea to add a graph/explanation about the Exchange
lifecycle to:

https://camel.apache.org/manual/lifecycle.html

and/or

https://camel.apache.org/manual/exchange.html

On Mon, Jan 30, 2023 at 3:56 PM Claus Ibsen <claus.ib...@gmail.com> wrote:

> It has always been like that, when an exchange is created an event is
> fired.
> Multicast / split create exchange (sub exchanges) and thus events.
>
> You can see if its a sub exchange as it has exchange property
> CORRELATION_ID that points to its parent.
> So if you only want parent exchanges, then filter based on CORRELATION_ID
> is not present.
>
>
> On Mon, Jan 30, 2023 at 3:07 PM Ephemeris Lappis <
> ephemeris.lap...@gmail.com>
> wrote:
>
> > Hello.
> >
> > After more tests I think I have more or less an idea of the origin of
> > the events, but an explanation should be welcome.
> >
> > In some cases, the 3rd route produces two files, and in some of these
> > cases, they use a multicast.
> > The multicast seems to be the cause of the repeated events.
> >
> > I've tried setting the multicast to use the same unit of work, as I
> > suppose that the same UoW ualo uses the same exchange, but it doesn't
> > change events.
> >
> > @Claus Ibsen Could you please explain what occurs when multicast is
> > used, with or without setting the unit of work ?
> >
> > The same 3 routes without multicast are realized with 3 exchanges, and
> > the expected events.
> >
> > Thanks for your help.
> >
> > Regards.
> >
> > Le lun. 30 janv. 2023 à 14:16, Claus Ibsen <claus.ib...@gmail.com> a
> > écrit :
> > >
> > > Hi
> > >
> > > This is expected as you use seda, that creates a new exchange
> > > If you use direct then no exchange is created
> > >
> > > On Mon, Jan 30, 2023 at 1:51 PM Ephemeris Lappis <
> > ephemeris.lap...@gmail.com>
> > > wrote:
> > >
> > > > Hello.
> > > >
> > > > Debugging some routes with an EventNotifier it seems that the event
> > > > ExchangecReated and ExchangeCompleted are repeated twice (I mean 3
> > > > times instead of 1).
> > > >
> > > > My tested application routes are all on the same pattern :
> > > > - route 1 : from JMS queue1 to JMS queue2
> > > > - route 2 : from JMS queue2 to seda
> > > > - route 3 : from seda to file
> > > >
> > > > In route 1 and 2 events are fired only once, but in route 3, I have 3
> > > > events fired while the route is executed only once with only one file
> > > > produced (and logs confirm I reach this part of the route only once).
> > > > The ExchangeSent is fired only on the last exchange ID.
> > > >
> > > > All the exchange IDs are incremented as usual. Below, the logs :
> > > > 13:01:42.540 [Camel (bbbmmm002-f002_context) thread #1 -
> > > > JmsConsumer[bbbmmm002-f002.from.alice.queue]] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts created exchange : 1 [ID=29A6D5065A7A1B6-0000000000000000 /
> > > > route=acq_bbbmmm002-f002]
> > > > 13:01:42.579 [Camel (bbbmmm002-f002_context) thread #2 -
> > > > JmsConsumer[bbbmmm002-f002.internal.queue]] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts created exchange : 2 [ID=29A6D5065A7A1B6-0000000000000001 /
> > > > route=trf_bbbmmm002-f002]
> > > > 13:01:42.585 [Camel (bbbmmm002-f002_context) thread #1 -
> > > > JmsConsumer[bbbmmm002-f002.from.alice.queue]] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts completed exchange : 2 [ID=29A6D5065A7A1B6-0000000000000000 /
> > > > route=acq_bbbmmm002-f002]
> > > > 13:01:42.751 [Camel (bbbmmm002-f002_context) thread #2 -
> > > > JmsConsumer[bbbmmm002-f002.internal.queue]] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts completed exchange : 2 [ID=29A6D5065A7A1B6-0000000000000001 /
> > > > route=trf_bbbmmm002-f002]
> > > > 13:01:43.406 [Camel (bbbmmm002-f002_context) thread #3 -
> > > > seda://diff_bbbmmm002-f002] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts created exchange : 3 [ID=29A6D5065A7A1B6-0000000000000002 /
> > > > route=diff_bbbmmm002-f002]
> > > > 13:01:43.414 [Camel (bbbmmm002-f002_context) thread #3 -
> > > > seda://diff_bbbmmm002-f002] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts created exchange : 4 [ID=29A6D5065A7A1B6-0000000000000003 /
> > > > route=diff_bbbmmm002-f002]
> > > > 13:01:43.441 [Camel (bbbmmm002-f002_context) thread #3 -
> > > > seda://diff_bbbmmm002-f002] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts completed exchange : 4 [ID=29A6D5065A7A1B6-0000000000000003 /
> > > > route=diff_bbbmmm002-f002]
> > > > 13:01:43.442 [Camel (bbbmmm002-f002_context) thread #3 -
> > > > seda://diff_bbbmmm002-f002] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts created exchange : 5 [ID=29A6D5065A7A1B6-0000000000000004 /
> > > > route=diff_bbbmmm002-f002]
> > > > 13:01:43.453 [Camel (bbbmmm002-f002_context) thread #3 -
> > > > seda://diff_bbbmmm002-f002] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts completed exchange : 5 [ID=29A6D5065A7A1B6-0000000000000004 /
> > > > route=diff_bbbmmm002-f002]
> > > > 13:01:43.455 [Camel (bbbmmm002-f002_context) thread #3 -
> > > > seda://diff_bbbmmm002-f002] INFO
> > > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > > counts completed exchange : 5 [ID=29A6D5065A7A1B6-0000000000000002 /
> > > > route=diff_bbbmmm002-f002]
> > > >
> > > > Is it a bug, or what is the real expected behavior of these events ?
> > > > Does it come from the seda component ?
> > > >
> > > > Thanks for your help.
> > > >
> > > > Regards.
> > > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
> >
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Reply via email to