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

Raymond commented on CAMEL-20540:
---------------------------------

Good call on the message history. Basically, I want something very close to 
this (basically the message history what goes into a route and out of route as 
json).

The message history however has the same issue. I could for example check the 
"ExchangeCompleted" event, instead of the "ExchangeCreated" event, but this 
leaves some issues:

1. Message history logs every processing step, while for me a route is one 
atomic step.
2. There is no way to determine what the beginning of the route is or not. This 
is because message history doesn't have this information as it sees multiple 
routes connected with the direct endpoint as one exchange.
3. Message history doesn't log "from" steps. These are the ones I'm most 
interested in (just start and end of the route).

As a sidenote, I would prefer this syntax:


List<MessageHistory> messages = exchange.getHistory(){color:#cc7832};{color}
Instead of


List<MessageHistory> messages = 
exchange.getProperty(Exchange.{color:#9876aa}MESSAGE_HISTORY{color}{color:#cc7832},
 {color}List.{color:#cc7832}class{color}){color:#cc7832};{color}

Second syntax means you need to read the documentation, but with first you can 
discover it by using Javadoc or just try to API in IntelliJ.

> Add RouteExchangeIn and RouteExchangeOut events
> -----------------------------------------------
>
>                 Key: CAMEL-20540
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20540
>             Project: Camel
>          Issue Type: Wish
>    Affects Versions: 4.4.0
>            Reporter: Raymond
>            Priority: Minor
>
> In my Camel based platform I currently use Camel 3. There, users can add a 
> route or kamelet per task.
> Example:
> {code:java}
> <route routeid="1">
>   <from uri="activemq:SomeQueue"/>
>     //some task
>     <to uri="direct-vm:2"/>
> </route>
> <route routeid="2">
>   <from uri="direct-vm:2"/>
>     //some task
>   <to uri="direct-vm:3"/>
> </route>
> <route routeid="3">
>   <from uri="direct-vm:3"/>
>     //some task
>     <to uri="sftp:myserver"/>
> </route>    {code}
> I use the Event Notifier to get events to show the message that goes into 
> each route. For this the event *ExchangeCreated* is used 
> ([https://www.javadoc.io/doc/org.apache.camel/camel-api/latest/org/apache/camel/spi/CamelEvent.html)].
> For each route I get a copy of the message Exchange with the breadcrumbid. 
> This works because the routes are connected either through:
> 1. direct-vm
> 2. vm
> 3. activemq
> Now I like to migrate to Camel 4. The issue is that direct-vm and vm aren't 
> available anymore since Camel 4.0:
> [https://camel.apache.org/manual/camel-4-migration-guide.html]
> The problem is that a direct endpoint has only 1 ExchangeCreated event over 
> multiple routes.
> I wish to have a RouteExchangeIn and RouteExchangeOut CamelEvent, so that I 
> can still offer this functionality. The nice thing is that this then would 
> work for all endpoints.
>  



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

Reply via email to