@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); executor = Executors.newFixedThreadPool(CONCURRENT_EVENT_PROCESSING_THREADS, new PersistedEventProcessingThreadFactory()); }
@Override public void stop(ILifecycleProgressMonitor monitor) throws SiteWhereException { if (executor != null) { executor.shutdownNow(); } super.stop(monitor); }
@Override public void process(TopicPartition topicPartition, List<ConsumerRecord<String, byte[]>> records) { try { attemptToProcess(topicPartition, records); getConsumer().commitAsync(new OffsetCommitCallback() { public void onComplete(Map<TopicPartition, OffsetAndMetadata> offsets, Exception e) { if (e != null) { getLogger().error("Commit failed for offsets " + offsets, e); } } }); } catch (SiteWhereException e) { getLogger().error("Exception in consumer processing.", e); } catch (Throwable e) { getLogger().error("Unhandled exception in consumer processing.", e); } }
@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.initialize(monitor); this.outboundPayloadEnrichmentLogic = new OutboundPayloadEnrichmentLogic( (IInboundProcessingTenantEngine) getTenantEngine()); }
public void onComplete(Map<TopicPartition, OffsetAndMetadata> offsets, Exception e) { if (e != null) { getLogger().error("Commit failed for offsets " + offsets, e); } } });
@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.initialize(monitor); initializeNestedComponent(getRuleProcessor(), monitor, true); }
@Override public void stop(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.stop(monitor); if (executor != null) { executor.shutdown(); } }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); executor = Executors.newFixedThreadPool(CONCURRENT_TENANT_BOOTSTRAP_THREADS, new TenantBootstrapperThreadFactory()); }
@Override public void stop(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.stop(monitor); if (executor != null) { executor.shutdown(); } }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); executor = Executors.newFixedThreadPool(CONCURRENT_EVENT_PROCESSING_THREADS, new CommandInvocationProcessorThreadFactory()); }
@Override public void stop(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.stop(monitor); if (executor != null) { executor.shutdown(); try { executor.awaitTermination(10, TimeUnit.SECONDS); } catch (InterruptedException e) { getLogger().warn("Executor did not terminate within allotted time."); } } }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); executor = Executors.newFixedThreadPool(CONCURRENT_REGISTRATION_PROCESSING_THREADS, new DeviceRegistrationProcessorThreadFactory()); }
@Override public void stop(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.stop(monitor); if (executor != null) { executor.shutdown(); try { executor.awaitTermination(10, TimeUnit.SECONDS); } catch (InterruptedException e) { getLogger().warn("Executor did not terminate within allotted time."); } } }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); executor = Executors.newFixedThreadPool(CONCURRENT_EVENT_PROCESSING_THREADS, new UnregisteredEventProcessorThreadFactory()); }
@Override public void stop(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.stop(monitor); if (executor != null) { executor.shutdown(); try { executor.awaitTermination(10, TimeUnit.SECONDS); } catch (InterruptedException e) { getLogger().warn("Executor did not terminate within allotted time."); } } }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); executor = Executors.newSingleThreadExecutor(new MicroserviceStateUpdateThreadFactory()); executor.execute(new StateUpdateProcessor()); }
@Override public void stop(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.stop(monitor); if (executor != null) { executor.shutdown(); try { executor.awaitTermination(10, TimeUnit.SECONDS); } catch (InterruptedException e) { getLogger().error("Rule processor host did not terminate within timout period."); } } stopNestedComponent(getRuleProcessor(), monitor); }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); startNestedComponent(getRuleProcessor(), monitor, true); executor = Executors.newFixedThreadPool(getRuleProcessor().getNumProcessingThreads(), new EventPayloadProcessorThreadFactory()); }