[
https://issues.apache.org/jira/browse/CAMEL-11585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16112253#comment-16112253
]
ASF GitHub Bot commented on CAMEL-11585:
----------------------------------------
GitHub user vrlgohel opened a pull request:
https://github.com/apache/camel/pull/1864
CAMEL-11585: Added JMX Reset counter via actuator
Fix for issue: https://issues.apache.org/jira/browse/CAMEL-11585.
As discussed in the previous PR's, now if the user uses an incorrect route
id, we can see the below 400 error,
2017-08-02 18:48:06.555 INFO 21505 --- [ XNIO-3 task-1]
org.apache.camel.impl.RouteService : {"headers":{},"body":"The provided
route id does not exists :
null","statusCode":"BAD_REQUEST","statusCodeValue":400}
2017-08-02 18:48:08.630 INFO 21505 --- [1 - timer://bar] bar
: From timer (bar) ...
2017-08-02 18:48:08.632 INFO 21505 --- [2 - timer://foo] foo
: From timer (foo) ...
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/vrlgohel/camel-1 CAMEL-11585
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1864.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1864
----
commit bac90b1a5c8c788210765407a3bae3b2c883b426
Author: Viral Gohel <[email protected]>
Date: 2017-08-03T06:14:26Z
CAMEL-11585: Added JMX Reset counter via actuator
----
> camel-spring-boot - Allow to reset route statistics via actuator
> ----------------------------------------------------------------
>
> Key: CAMEL-11585
> URL: https://issues.apache.org/jira/browse/CAMEL-11585
> Project: Camel
> Issue Type: Improvement
> Components: camel-spring-boot
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 2.20.0
>
>
> You can start/stop/suspend/resume routes etc. But it would also be nice to be
> able to reset the JMX statistics.
> for example if you stop and start a route, then it continues with the
> existing JMX stats (but sometimes you want to be able to reset).
> {code}
> 8080/camel/routes/bar/info
> {"id":"bar","uptimeMillis":0,"status":"Stopped","details":{"deltaProcessingTime":0,"exchangesInflight":0,"exchangesTotal":103,"externalRedeliveries":0,"failuresHandled":0,"firstExchangeCompletedExchangeId":"ID-davsclaus-pro-local-1500797880917-0-1","firstExchangeCompletedTimestamp":1500797883793,"lastExchangeCompletedExchangeId":"ID-davsclaus-pro-local-1500797880917-0-205","lastExchangeCompletedTimestamp":1500798394054,"lastProcessingTime":0,"maxProcessingTime":4,"meanProcessingTime":0,"minProcessingTime":0,"redeliveries":0,"totalProcessingTime":30,"hasRouteController":false}}davsclaus:/Users/davsclaus/$
> curl -XGET -s http://localhost:8080/camel/routes/bar/info^C
> davsclaus:/Users/davsclaus/$ ^C
> davsclaus:/Users/davsclaus/$ ^C
> davsclaus:/Users/davsclaus/$ curl -XGET -s
> http://localhost:8080/camel/routes/bar^C
> davsclaus:/Users/davsclaus/$ curl -XPOST -s
> http://localhost:8080/camel/routes/bar/start
> davsclaus:/Users/davsclaus/$ curl -XGET -s
> http://localhost:8080/camel/routes/bar/info
> {"id":"bar","uptime":"1.701
> seconds","uptimeMillis":1701,"status":"Started","details":{"deltaProcessingTime":0,"exchangesInflight":0,"exchangesTotal":104,"externalRedeliveries":0,"failuresHandled":0,"firstExchangeCompletedExchangeId":"ID-davsclaus-pro-local-1500797880917-0-1","firstExchangeCompletedTimestamp":1500797883793,"lastExchangeCompletedExchangeId":"ID-davsclaus-pro-local-1500797880917-0-218","lastExchangeCompletedTimestamp":1500798449710,"lastProcessingTime":0,"maxProcessingTime":4,"meanProcessingTime":0,"minProcessingTime":0,"redeliveries":0,"totalProcessingTime":30,"hasRouteController":true}}davsclaus:/Users/davsclaus/$
> curl -XGET -s http://localhost:8080/camel/routes/bar/info
> {code}
> So we need a reset command
> curl -XPOST -s http://localhost:8080/camel/routes/bar/reset
> That just calls the JMX reset operation on the route mbean. It should also
> reset the processors, eg call this with true
> @ManagedOperation(description = "Reset counters")
> void reset(boolean includeProcessors) throws Exception;
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)