@Override protected void doStart() throws Exception { super.doStart(); }
@Override protected void doStop() throws Exception { if(taskSession!=null) taskSession.interrupt(); super.doStop(); }
@Override protected void doStart() throws Exception { LOG.info(Thread.currentThread().getName()); // if (taskSession == null){ taskSession = new OCamelTaskSession(); taskSession.setOTask(config); taskSession.setCallback(callback); Object deleteOnFinish = config.getDocument().field(OTask.Field.AUTODELETE_SESSIONS.fieldName()); taskSession.setDeleteOnFinish(deleteOnFinish!=null?(Boolean)deleteOnFinish:false); taskSession.setConfig(config.getDocument().getIdentity().toString()); taskSession.setFinalProgress(context.getRoutes().size()); taskSession.start(); // } super.doStart(); }
@Override protected void doStart() throws Exception { super.doStart(); if (meterRegistry == null) { meterRegistry = MicrometerUtils.getOrCreateMeterRegistry(camelContext.getRegistry(), METRICS_REGISTRY_NAME); } try { MicrometerEventNotifierService registryService = camelContext.hasService(MicrometerEventNotifierService.class); if (registryService == null) { registryService = new MicrometerEventNotifierService(); registryService.setMeterRegistry(getMeterRegistry()); registryService.setPrettyPrint(isPrettyPrint()); registryService.setDurationUnit(getDurationUnit()); registryService.setMatchingTags(Tags.of(SERVICE_NAME, registryService.getClass().getSimpleName())); camelContext.addService(registryService); // ensure registry service is started ServiceHelper.startService(registryService); } } catch (Exception e) { throw ObjectHelper.wrapRuntimeCamelException(e); } }