[
https://issues.apache.org/jira/browse/CAMEL-24887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18124444#comment-18124444
]
Raymond commented on CAMEL-24887:
---------------------------------
Largely agree with the AI analyses here. n the decisions:
1. Naming
I am aware of JTA transaction, which are transactions that see a task a singe
atomic unit, that can be rolled back when somewhere in the route anything. Of
course these "transactions" have nothing to do it, but is generally also called
transaction. For example I have four routes:
Route1: Consuming route
Route2: Choice if go to route 3 or route 4
Route3: A route that split the message up into 3 messages
Route4: A route that handles anoter case
If the message travels through Route1, Route2, Route 3 then it has for example
5 exchanges
If the message travels through Route1, Route2, Route 4 then it has for example
3 exchanges
However in both case if all routes belong to the same RouteGroup it's 1
"transaction". If the naming is however to confusion with JTA transactions.
then {{{}getGroupExchangesCompleted{}}}() is a fine name as well.
2. Scope
For me it's not only about the exchange counts, I use the other metrics on the
RouteGroup (processing times) as well, but this could also be implemented in a
separate issue.
3. Edge cases
Say the route A uses a splitter or multicast and the some go to route B and
some to route C. All messages to B are completed, and in C one fails. Then for
example route B has only Completed exchanges, and route C has one 1 failed.
However it enters the route group as 1 message, and then as soon as 1 fails, it
should see the Route Group Exchange / Transaction as failed. User can then
drill down to the route level to see which exchange failed.
I don't know if this provides additional context for the AI, but this currently
how I get the statistics:
https://github.com/assimbly/runtime/blob/next/integration/src/main/java/org/assimbly/integration/impl/manager/StatsManager.java
Sometimes I need to calculate things on group level. Probably with this change
it's not needed anymore.
Very cool improvements. Hope it reaches 4.23.0
> ManagedRouteGroupMBean exchange stats changed
> ---------------------------------------------
>
> Key: CAMEL-24887
> URL: https://issues.apache.org/jira/browse/CAMEL-24887
> Project: Camel
> Issue Type: Bug
> Components: camel-jmx
> Affects Versions: 4.22.1
> Reporter: Raymond
> Assignee: Torsten Mielke
> Priority: Minor
> Fix For: 4.22.2, 4.23.0
>
>
> In 4.22.1 the exchange stats in the {{ManagedRouteGroupMBean}} changed.
> As an example I have created a route group X with two routes X1 and X2. Now I
> would like to get how many "transactions" the group processed. I used:
> {{ManagedRouteGroupMBean managedRouteGroup =
> managedContext.getManagedRouteGroup("X");}}
> {{managedRouteGroup.getExchangesCompleted()}}
> Now when I processed 1 message/transaction I would like to get the number 1,
> etc. This worked until 4.22.0, but this recently changed.
> In 4.22.0 the result was 1
> In 4.22.1 the result is 2
> The second is the aggregated processed exchanges of all routes in the group.
> This is useful too, but I would still like to have the old result. This can
> be in a separated method:
> {{managedRouteGroup.getExchangesCompleted() --> 1}}
> {{managedRouteGroup.getAggegatedExchangesCompleted() --> 2}}
> or
> {{managedRouteGroup.getTransactionsCompleted() --> 1}}
> {{managedRouteGroup.getExchangesCompleted() --> 2}}
> This may have changed after this issue:
> https://issues.apache.org/jira/browse/CAMEL-24590
--
This message was sent by Atlassian Jira
(v8.20.10#820010)