public BergamotAccountingQueueConsumer() { super(); this.queue = AccountingQueue.open(); this.producer = this.queue.publishAccountingEvents(); }
private void setupQueues() { this.queue = HealthCheckQueue.open(); this.healthcheckProducer = this.queue.publishHealthCheckEvents(); this.healthcheckConsumer = this.queue.consumeHealthCheckControlEvents(this::handleHealthCheckMessage); }
public void init(CommandProcessor processor) { this.queue = BergamotAgentManagerQueue.open(); this.client = this.queue.createBergamotAgentManagerRPCClient(); }
this.workerQueue = WorkerQueue.open(); this.resultConsumers.add(this.workerQueue.consumeResults((r) -> { logger.trace("Processing pooled/site result"); processExecuted(r); }, this.instanceId.toString())); this.fallbackConsumers.add(this.workerQueue.consumeFallbackResults((r) -> { logger.debug("Processing fallback result"); processExecuted(r); })); this.deadConsumers.add(this.workerQueue.consumeDeadChecks((e) -> { processDead(e); })); this.deadAgentConsumers.add(this.workerQueue.consumeDeadAgentChecks((e) -> { processDeadAgent(e); })); this.schedulerQueue = SchedulerQueue.open(); this.schedulerActionProducer = this.schedulerQueue.publishSchedulerActions(); this.notificationsQueue = NotificationQueue.open(); this.notificationsProducer = this.notificationsQueue.publishNotifications(); this.updateQueue = UpdateQueue.open(); this.updateProducer = this.updateQueue.publishUpdates();
try (SchedulerQueue queue = SchedulerQueue.open()) try (RoutedProducer<SchedulerAction, SchedulerKey> producer = queue.publishSchedulerActions()) try (NotificationQueue notificationQueue = NotificationQueue.open()) try (RoutedProducer<Notification, NotificationKey> notificationsProducer = notificationQueue.publishNotifications()) new NotificationKey(contact.getSite().getId()), new RegisterContactNotification(contact.getSite().toMOUnsafe(), contact.toMOUnsafe().addEngine("email"), url) );
protected void startQueues() throws Exception { this.workerQueue = WorkerQueue.open(); this.executeCheckProducer = this.workerQueue.publishChecks(); this.schedulerQueue = SchedulerQueue.open(); // TODO scheduler names this.schedulerActionConsumer = this.schedulerQueue.consumeSchedulerActions((a) -> { executeAction(a); }); }
@Override public void start() throws Exception { // open the queue this.controlQueue = ControlQueue.open(); this.watcherQueue = WatcherQueue.open(); this.workerQueue = WorkerQueue.open(); // control this.controlEventProducer = this.controlQueue.publishControlEvents(); // watcher this.watcherEventConsumer = this.watcherQueue.consumeWatcherEvents(this, this.getWatcher().getId(), this.getName()); // results this.resultProducer = this.workerQueue.publishResults(); // start the executors for (Executor<?> ex : this.getExecutors()) { ex.start(); } // register with the controller this.controlEventProducer.publish(new RegisterWatcher(this.getWatcher().getId(), this.getName(), this.getWatcher().getSite(), this.getWatcher().getLocation())); }
@Override public void start() { // setup the consumer logger.info("Creating readings consumer"); this.workerQueue = WorkerQueue.open(); // create the consumers for (int i = 0; i < this.getThreads(); i++) { // consume results, currently for all sites this.readingConsumers.add(this.workerQueue.consumeReadings((r) -> { logger.trace("Processing pooled/site readings"); processReadings(r); }, this.instanceId.toString())); // consume results, currently for all sites this.fallbackConsumers.add(this.workerQueue.consumeFallbackReadings((r) -> { logger.debug("Processing fallback readings"); processReadings(r); })); } } }
@Override public void start() throws Exception { // open the queue this.queue = NotificationQueue.open(); // start all the consumers for (int i = 0; i < this.configuration.getThreads(); i++) { logger.info("Creating consumer " + i); this.consumers.add(this.queue.consumeNotifications(this::sendNotification, this.getSite(), this.getNotifierName())); } }
public RoutedProducer<Notification, NotificationKey> publishNotifications() { return this.publishNotifications(null); }
public RoutedProducer<SchedulerAction, SchedulerKey> publishSchedulerActions() { return this.publishSchedulerActions(null); }
public RoutedProducer<ExecuteCheck, WorkerKey> publishChecks() { return this.publishChecks(null); }
public RoutedProducer<Update, UpdateKey> publishUpdates() { return this.publishUpdates(null); }
public RoutedProducer<ResultMO, ResultKey> publishResults() { return this.publishResults(null); }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void start() { // open the command queue this.commandQueue = BergamotCommandQueue.open(); // setup the servers for (int i = 0; i < this.threads; i++) { this.commandServers.add( this.commandQueue.createBergamotCommandRPCServer((request) -> { // lookup the command handler and process the request if (request != null) { BergamotCommandHandler handler = this.getHandler(request.getClass()); if (handler != null) { return handler.process(request); } else { logger.warn("Failed to find command handler for request: " + request.getClass()); } } return null; }) ); } } }
public Consumer<ExecuteCheck, WorkerKey> consumeChecks(DeliveryHandler<ExecuteCheck> handler, UUID site, String workerPool, String engine) { return this.consumeChecks(handler, site, workerPool, engine, false, null); }
public RoutedProducer<ReadingParcelMO, ReadingKey> publishReadings() { return this.publishReadings(null); }