synchronized ExecutorService getOrCreatePollingConsumerExecutorService() { if (pollingConsumerExecutorService == null) { LOG.debug("Creating thread pool for JpaPollingConsumer to support polling using timeout"); pollingConsumerExecutorService = getCamelContext().getExecutorServiceManager().newDefaultThreadPool(this, "JpaPollingConsumer"); } return pollingConsumerExecutorService; }
private Executor getExecutor() { if (executor == null) { executor = getCamelContext().getExecutorServiceManager() .newDefaultThreadPool(this, device.getDeviceName()); } return executor; }
@Override public void doStart() throws Exception { super.doStart(); this.exchange = this.endpoint.createAMQPExchange(); if (this.endpoint.isUsingDefaultExchange()) { LOG.info("Using default exchange of type {}", this.exchange.getClass().getSimpleName()); } else { LOG.info("Declaring exchange {} of type {}", this.exchange.getName(), this.exchange.getClass().getSimpleName()); try { this.endpoint.amqpAdministration.declareExchange(this.exchange); } catch(AmqpIOException e) { //The actual reason for failed exceptions is often swallowed up by Camel or Spring, find it Throwable rootCause = SpringAMQPComponent.findRootCause(e); LOG.error("Could not initialize exchange!", rootCause); throw e; } catch (AmqpConnectException e) { LOG.error("Producer cannot connect to broker - stopping endpoint {}", this.endpoint.toString(), e); stop(); this.endpoint.stop(); return; } } //Initialize execution pool this.threadPool = this.endpoint.getCamelContext().getExecutorServiceManager().newDefaultThreadPool(this, "amqp-producer"); }
@Override public void doStart() throws Exception { super.doStart(); this.exchange = this.endpoint.createAMQPExchange(); if (this.endpoint.isUsingDefaultExchange()) { LOG.info("Using default exchange of type {}", this.exchange.getClass().getSimpleName()); } else { LOG.info("Declaring exchange {} of type {}", this.exchange.getName(), this.exchange.getClass().getSimpleName()); try { this.endpoint.amqpAdministration.declareExchange(this.exchange); } catch(AmqpIOException e) { //The actual reason for failed exceptions is often swallowed up by Camel or Spring, find it Throwable rootCause = SpringAMQPComponent.findRootCause(e); LOG.error("Could not initialize exchange!", rootCause); throw e; } catch (AmqpConnectException e) { LOG.error("Producer cannot connect to broker - stopping endpoint {}", this.endpoint.toString(), e); stop(); this.endpoint.stop(); return; } } //Initialize execution pool this.threadPool = this.endpoint.getCamelContext().getExecutorServiceManager().newDefaultThreadPool(this, "amqp-producer"); }
@Override protected void doStart() throws Exception { ObjectHelper.notNull(camelContext, "CamelContext", this); timeoutLogger = new CamelLogger(LOG, timeoutLoggingLevel); if (scheduledExecutorService == null) { scheduledExecutorService = camelContext.getExecutorServiceManager().newSingleThreadScheduledExecutor(this, "NettyTimeoutCorrelationManager"); } if (workerPool == null) { workerPool = camelContext.getExecutorServiceManager().newDefaultThreadPool(this, "NettyTimeoutWorkerPool"); } map = new NettyStateTimeoutMap(scheduledExecutorService); ServiceHelper.startService(map); }