public CDRConsumer() { this.executor = TaskExecutor.getInstance(); }
public BillConsumer() { this.executor = TaskExecutor.getInstance(); }
public UsageConsumer() { this.executor = TaskExecutor.getInstance(); }
/** * Schedule another micro service check */ public synchronized void scheduleCheck() { TaskExecutor.getInstance().addScheduledTask(new HealthCheck(), period, period, unit); }
/** * Schedule another micro service check */ public synchronized void scheduleCheck() { TaskExecutor.getInstance().addScheduledTask(new HealthCheck(), period, period, unit); }
/** * Schedule another micro service check */ public synchronized void scheduleCheck() { TaskExecutor.getInstance().addScheduledTask(new HealthCheck(), period, period, unit); }
/** * Schedule another micro service check */ public synchronized void scheduleCheck() { TaskExecutor.getInstance().addScheduledTask(new HealthCheck(), period, period, unit); }
/** * Nack and optionally schedule a health check */ private void nackAndScheduleHealthCheck() { if (deliveryTag != null) consumer.nackMessage(deliveryTag); if (healthCheck) TaskExecutor.getInstance().executeNow(new HealthCheck()); }
/** * Nack and optionally schedule a health check */ private void nackAndScheduleHealthCheck() { if (deliveryTag != null) consumer.nackMessage(deliveryTag); if (healthCheck) TaskExecutor.getInstance().executeNow(new HealthCheck()); }
/** * Nack and optionally schedule a health check */ private void nackAndScheduleHealthCheck() { if (deliveryTag != null) consumer.nackMessage(deliveryTag); if (healthCheck) TaskExecutor.getInstance().executeNow(new HealthCheck()); }
@Override public void run() { logger.trace("We are shutting down Billing micro service"); // shut down executor service TaskExecutor.getInstance().forceShutDown(); // and Consumer (RabbitMQ) ConsumeManager.stopDataAndCommandProcessing(); // don't forget about Publisher (RabbitMQ) RabbitMQPublisher.shutDown(); // as well as db pool manager new DbAccess().shutDown(); } }
@Override public void run() { logger.trace("We are shutting down UDR micro service"); // shut down executor service TaskExecutor.getInstance().forceShutDown(); // and Consumer (RabbitMQ) ConsumeManager.stopDataAndCommandProcessing(); // don't forget about Publisher (RabbitMQ) RabbitMQPublisher.shutDown(); // as well as db pool manager new DbAccess().shutDown(); } }
@Override public void run() { logger.trace("We are shutting down CDR micro service"); // shut down executor service TaskExecutor.getInstance().forceShutDown(); // and Consumer (RabbitMQ) ConsumeManager.stopDataAndCommandProcessing(); // don't forget about Publisher (RabbitMQ) RabbitMQPublisher.shutDown(); // as well as db pool manager new DbAccess().shutDown(); } }
/** * Pause the microservice and schedule a check */ protected synchronized void setUnhealthy(String why) { if (healthy) { healthy = false; reason = why; resetWatch(); // cancel all tasks in the task executor service TaskExecutor.getInstance().shutDown(); // stop listening for commands and pause data ingestion ConsumeManager.stopConsumption(); // shut down also RabbitMQ Publisher RabbitMQPublisher.shutDown(); // optionally kill the micro service if (kill) System.exit(Main.ERR_HEALTH); // schedule micro service check scheduleCheck(); } }
/** * ACK the message if it is coming from RabbitMQ, but publish it via an exchange * In case that publishing fails, NACK it and optionally schedule a health check */ private void publishAndIfSuccessfulAck() { if (deliveryTag != null) { boolean published = Messenger.publish(content, INVALID_RECORDS_ROUTING_KEY); if (published) consumer.ackMessage(deliveryTag); else { consumer.nackMessage(deliveryTag); if (healthCheck) TaskExecutor.getInstance().executeNow(new HealthCheck()); } } }
/** * ACK the message if it is coming from RabbitMQ, but publish it via an exchange * In case that publishing fails, NACK it and optionally schedule a health check */ private void publishAndIfSuccessfulAck() { if (deliveryTag != null) { boolean published = Messenger.publish(content, INVALID_RECORDS_ROUTING_KEY); if (published) consumer.ackMessage(deliveryTag); else { consumer.nackMessage(deliveryTag); if (healthCheck) TaskExecutor.getInstance().executeNow(new HealthCheck()); } } }
/** * ACK the message if it is coming from RabbitMQ, but publish it via an exchange * In case that publishing fails, NACK it and optionally schedule a health check */ private void publishAndIfSuccessfulAck() { if (deliveryTag != null) { boolean published = Messenger.publish(content, INVALID_RECORDS_ROUTING_KEY); if (published) consumer.ackMessage(deliveryTag); else { consumer.nackMessage(deliveryTag); if (healthCheck) TaskExecutor.getInstance().executeNow(new HealthCheck()); } } }
/** * Pause the microservice and schedule a check */ protected synchronized void setUnhealthy(String why) { if (healthy) { healthy = false; reason = why; resetWatch(); // cancel all tasks in the task executor service TaskExecutor.getInstance().shutDown(); // stop listening for commands and pause data ingestion ConsumeManager.stopDataAndCommandProcessing(); // shut down also RabbitMQ Publisher RabbitMQPublisher.shutDown(); // close the database pool new DbAccess().shutDown(); // optionally kill the micro service if (kill) System.exit(Main.ERR_HEALTH); // schedule micro service check scheduleCheck(); } }
/** * Pause the microservice and schedule a check */ protected synchronized void setUnhealthy(String why) { if (healthy) { healthy = false; reason = why; resetWatch(); // cancel all tasks in the task executor service TaskExecutor.getInstance().shutDown(); // stop listening for commands and pause data ingestion ConsumeManager.stopDataAndCommandProcessing(); // shut down also RabbitMQ Publisher RabbitMQPublisher.shutDown(); // close the database pool new DbAccess().shutDown(); // optionally kill the micro service if (kill) System.exit(Main.ERR_HEALTH); // schedule micro service check scheduleCheck(); } }
/** * Pause the microservice and schedule a check */ protected synchronized void setUnhealthy(String why) { if (healthy) { healthy = false; reason = why; resetWatch(); // cancel all tasks in the task executor service TaskExecutor.getInstance().shutDown(); // stop listening for commands and pause data ingestion ConsumeManager.stopDataAndCommandProcessing(); // shut down also RabbitMQ Publisher RabbitMQPublisher.shutDown(); // close the database pool new DbAccess().shutDown(); // optionally kill the micro service if (kill) System.exit(Main.ERR_HEALTH); // schedule micro service check scheduleCheck(); } }