You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]]]
The text was updated successfully, but these errors were encountered:
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:
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:
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:
The text was updated successfully, but these errors were encountered: