ManagedRouteMBean managedRoute = context.getManagedRoute(route.getId(), ManagedRouteMBean.class); if (managedRoute.getExchangesTotal() == 0) { uncoveredRoutes.add(route.getId()); routesSummary.append("\t\tRoute ").append(route.getId()).append(" total: ").append(managedRoute.getExchangesTotal()).append(" (").append(routeCoveragePercentage).append("%)\n"); List<ManagedProcessorMBean> processors = processorsForRoute.get(route.getId()); if (processors != null) { for (ManagedProcessorMBean managedProcessor : processors) {
private MetricsStatistics(Route route, Timer responses) { this.routeId = route.getId(); this.responses = responses; }
public MicrometerMessageHistory(MeterRegistry meterRegistry, Route route, NamedNode namedNode, MicrometerMessageHistoryNamingStrategy namingStrategy, long timestamp) { super(route.getId(), namedNode, timestamp); this.meterRegistry = meterRegistry; this.route = route; this.namingStrategy = namingStrategy; this.sample = Timer.start(meterRegistry); }
@ManagedAttribute(description = "The route id") public String getRouteId() { if (route != null) { return route.getId(); } return null; }
@ManagedAttribute(description = "The route id") public String getRouteId() { if (route != null) { return route.getId(); } return null; }
@Override public void onExchangeBegin(Route route, Exchange exchange) { super.onExchangeBegin(route, exchange); LOG.info("Exchange Begin for route " + route.getId() + " exchange: " + exchange.getExchangeId()); }
@Override public void onExchangeBegin(Route route, Exchange exchange) { super.onExchangeBegin(route, exchange); LOG.info("Exchange Begin for route " + route.getId() + " exchange: " + exchange.getExchangeId()); }
@Override public void onExchangeDone(Route route, Exchange exchange) { super.onExchangeDone(route, exchange); LOG.info("Exchange Done for route " + route.getId() + " exchange: " + exchange.getExchangeId() + " in: " + exchange.getIn().getBody(String.class)); stopCurrentRouteAsync(route); }
@Override public void onExchangeDone(Route route, Exchange exchange) { super.onExchangeDone(route, exchange); LOG.info("Exchange Done for route " + route.getId() + " exchange: " + exchange.getExchangeId() + " in: " + exchange.getIn().getBody(String.class)); try { stopRoute(route); } catch (Exception e) { throw new RuntimeExchangeException(e.getMessage(), exchange, e); } } }
private void stopConsumer(Route route) { synchronized (lock) { try { if (!suspendedRoutes.contains(route)) { LOGGER.debug("Stopping consumer for {} ({})", route.getId(), route.getConsumer()); stopConsumer(route.getConsumer()); suspendedRoutes.add(route); } } catch (Exception e) { handleException(e); } } }
private synchronized void startAllStoppedConsumers() { try { for (Route route : suspendedRoutes) { LOGGER.debug("Starting consumer for {} ({})", route.getId(), route.getConsumer()); startConsumer(route.getConsumer()); } suspendedRoutes.clear(); } catch (Exception e) { handleException(e); } }
private void startAllStoppedConsumers() { synchronized (lock) { try { for (Route route : suspendedRoutes) { LOGGER.debug("Starting consumer for {} ({})", route.getId(), route.getConsumer()); startConsumer(route.getConsumer()); } suspendedRoutes.clear(); } catch (Exception e) { handleException(e); } } }
@Override public synchronized void onInit(Route route) { super.onInit(route); LOGGER.info("Route managed by {}. Setting route {} AutoStartup flag to false.", getClass(), route.getId()); route.getRouteContext().getRoute().setAutoStartup("false"); stoppeddRoutes.add(route); this.refCount.retain(); startManagedRoutes(); }
default Tags getTags(Route route, Exchange exchange) { return Tags.of( CAMEL_CONTEXT_TAG, route.getRouteContext().getCamelContext().getName(), SERVICE_NAME, MicrometerRoutePolicyService.class.getSimpleName(), ROUTE_ID_TAG, route.getId(), FAILED_TAG, Boolean.toString(exchange.isFailed()) ); }
private void reportNonCustomRouteIDs(Route route) { CamelContext camelContext = route.getRouteContext().getCamelContext(); RouteDefinition routeDefinition = camelContext.getRouteDefinition(route.getId()); if (routeDefinition.getCustomId() == null || !routeDefinition.getCustomId()) { LOG.warn("Problem detected: Route " + StringUtils.quote(route.getId()) + " has no custom ID set! Endpoint URI is " + route.getEndpoint().getEndpointUri()); } }
default Tags getTags(Route route, NamedNode node) { return Tags.of( CAMEL_CONTEXT_TAG, route.getRouteContext().getCamelContext().getName(), SERVICE_NAME, MicrometerMessageHistoryService.class.getSimpleName(), ROUTE_ID_TAG, route.getId(), NODE_ID_TAG, node.getId() ); }
public RouteDetailsInfo(final CamelContext camelContext, final Route route) { super(route); if (camelContext.getManagementStrategy().getManagementAgent() != null) { this.routeDetails = new RouteDetails(camelContext.getManagedRoute(route.getId(), ManagedRouteMBean.class)); } }
@Override public void onInit(Consumer consumer) { this.consumer = consumer; // find the route of the consumer for (Route route : consumer.getEndpoint().getCamelContext().getRoutes()) { if (route.getConsumer() == consumer) { this.routeId = route.getId(); break; } } }
public RouteInfo(Route route) { this.id = route.getId(); this.description = route.getDescription(); this.uptime = route.getUptime(); this.uptimeMillis = route.getUptimeMillis(); if (route instanceof StatefulService) { this.status = ((StatefulService) route).getStatus().name(); } else { this.status = null; } }
@Override protected void doStart() throws Exception { super.doStart(); if (statement.isDestroyed()) { // statement is destroyed! re-init it! statement = endpoint.createStatement(getRoute().getId()); } if(endpoint.isListen()) { statement.addListener(this); } else { log.debug("Start esper consumer eql='"+endpoint.getEndpointConfiguration().getParameter("eql")+"' without listener!"); } }