You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2023/05/18 08:18:00 UTC

[jira] [Commented] (CAMEL-19367) CamelEvent.RouteCompleted

    [ https://issues.apache.org/jira/browse/CAMEL-19367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17723840#comment-17723840 ] 

Claus Ibsen commented on CAMEL-19367:
-------------------------------------

route events are just about routes added / removed etc.

the exchange events are for messages being routed inside camel. There is already events when an exchange is complete.
In your example the split create sub-exchanges, and you can see the last exchange completed in the events list has exchange id 0000 that was the first exchange.

So you could either

capture the created exchange event, and the exchange id
listen for completed events until you have a matching exchange id

or check inflight registry if the route has 0, or camel context has 0 in general (I assume you want to shutdown all of Camel)

so in the listener you can wait for completed exchanges and check inflight registry if its zero (however I need to check if you received the event before camel decrements the inflight counter, as otherwise it would be 1)



> CamelEvent.RouteCompleted
> -------------------------
>
>                 Key: CAMEL-19367
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19367
>             Project: Camel
>          Issue Type: Improvement
>    Affects Versions: 3.20.4
>            Reporter: Pasquale Congiusti
>            Priority: Major
>
> Hello team. While troubleshooting this Camel K issue [1], I've realized we're missing some route event that can tell us that the route was completed. Do you think it would be possible to include the `RouteCompleted` event? From what I can tell, it would be an event generated once all the steps of the route are completed. Without that, we don't know exactly when a route is terminated and it's fine to gracefully stop it.
> Any feedback or possible workaround is appreciated as well, thanks!
> [1] https://github.com/apache/camel-k/issues/4343



--
This message was sent by Atlassian Jira
(v8.20.10#820010)