You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/10/09 12:23:49 UTC

[GitHub] [camel-quarkus] jwwallin opened a new issue #1894: AdviceWithRouteBuilder replaceFromWith and microprofile-metrics conflict

jwwallin opened a new issue #1894:
URL: https://github.com/apache/camel-quarkus/issues/1894


   I'm trying to write tests for a quartz triggered route by replacing the original from-endpoint using `AdviceWithRouteBuilder.adviceWith(camelContext, "scheduler-daily", advisor -> {advisor.replaceFromWith("direct:scheduler-daily");})`.
   
   When I run the test, I get this error:
   ```
   org.apache.camel.FailedToCreateRouteException: Failed to create route scheduler-daily: Route(scheduler-daily)[From[direct:scheduler-daily] -> [Log[... because of A metric with metricID MetricID{name='camel.route.exchanges.inflight.count', tags=[camelContext="camel-1",routeId="scheduler-daily"]} already exists
           at TimerRouteTest.mockRouteEndpoints(TimerRouteTest.java:53)
   Caused by: java.lang.IllegalArgumentException: A metric with metricID MetricID{name='camel.route.exchanges.inflight.count', tags=[camelContext="camel-1",routeId="scheduler-daily"]} already exists
           at TimerRouteTest.mockRouteEndpoints(TimerRouteTest.java:53)
   ```
   
   Am I missing something or is there a bug in the way the replaceFromWith(...) interacts (or maybe doesn't interact) with camel-quarkus-microprofile-metrics?
   
   Log before the error looks like this:
   ```
   [INFO] Running TimerRouteTest
   2020-10-09 14:45:50,431 INFO  [org.apa.cam.com.qua.QuartzEndpoint] (main) Pausing trigger schedule.daily
   2020-10-09 14:45:50,433 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Route: scheduler-daily is stopped, was consuming from: quartz://schedule/daily
   2020-10-09 14:45:50,435 INFO  [org.apa.cam.com.qua.QuartzEndpoint] (main) Deleting job schedule.daily
   2020-10-09 14:45:50,437 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Route: scheduler-daily is shutdown and removed, was consuming from: quartz://schedule/daily
   2020-10-09 14:45:50,439 INFO  [org.apa.cam.bui.AdviceWithTasks] (main) AdviceWith replace input from [quartz://schedule/daily?cron=0+6+6+?+*+*] --> [direct:scheduler-daily]
   2020-10-09 14:45:50,439 INFO  [org.apa.cam.rei.RouteReifier] (main) AdviceWith route after: Route(scheduler-daily)[From[direct:scheduler-daily] -> [Log[Starting Scheduled daily ], To[direct:input-daily]]]
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #1894: AdviceWithRouteBuilder replaceFromWith and microprofile-metrics conflict

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #1894:
URL: https://github.com/apache/camel-quarkus/issues/1894#issuecomment-708328302


   I added a workaround to fix the issue for the 1.2.0 release.
   
   It'll be fixed properly when the project upgrades to Camel 3.6.0.
   
   https://issues.apache.org/jira/browse/CAMEL-15675
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jwwallin commented on issue #1894: AdviceWithRouteBuilder replaceFromWith and microprofile-metrics conflict

Posted by GitBox <gi...@apache.org>.
jwwallin commented on issue #1894:
URL: https://github.com/apache/camel-quarkus/issues/1894#issuecomment-706184488


   I disabled the route metrics as suggested and it works fine.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton closed issue #1894: AdviceWithRouteBuilder replaceFromWith and microprofile-metrics conflict

Posted by GitBox <gi...@apache.org>.
jamesnetherton closed issue #1894:
URL: https://github.com/apache/camel-quarkus/issues/1894


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #1894: AdviceWithRouteBuilder replaceFromWith and microprofile-metrics conflict

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #1894:
URL: https://github.com/apache/camel-quarkus/issues/1894#issuecomment-706164571


   It's probably a bug in the camel-microprofile-metrics component. Looks like `adviceWith` or `replaceFrom` results in an attempt to register a metric that already exists.
   
   You could try disabling the route metrics by adding the following to `application.properties`:
   ```
   quarkus.camel.metrics.enable-route-policy=false
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #1894: AdviceWithRouteBuilder replaceFromWith and microprofile-metrics conflict

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #1894:
URL: https://github.com/apache/camel-quarkus/issues/1894#issuecomment-706164571


   It's probably a bug in the camel-microprofile-metrics component. Looks like `adviceWith` or `replaceFrom` results in an attempt to register a metric that already exists.
   
   You could try disabling the route metrics by adding the following to `application.properties`:
   ```
   quarkus.camel.metrics.enable-route-policy=false
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org