Class MessageConsumerExecutor

java.lang.Object
com.codeheadsystems.queue.impl.MessageConsumerExecutor
All Implemented Interfaces:
io.dropwizard.lifecycle.Managed

@Singleton public class MessageConsumerExecutor extends Object implements io.dropwizard.lifecycle.Managed
The type Message consumer executor.
  • Constructor Details

    • MessageConsumerExecutor

      @Inject public MessageConsumerExecutor(QueueConfigurationFactory queueConfigurationFactory, MessageManager messageManager, QueueRegister queueRegister, com.codeheadsystems.metrics.Metrics metrics)
      Instantiates a new Message consumer executor.
      Parameters:
      queueConfigurationFactory - the configuration.
      messageManager - the message manager
      queueRegister - the queue register
      metrics - the metrics
  • Method Details

    • availableThreadCount

      public int availableThreadCount()
      Number of free threads in the executor service.
      Returns:
      the number of free threads.
    • enqueue

      public void enqueue(Message message)
      Enqueue.
      Parameters:
      message - the message
    • start

      public void start() throws Exception
      Specified by:
      start in interface io.dropwizard.lifecycle.Managed
      Throws:
      Exception
    • stop

      public void stop() throws Exception
      Specified by:
      stop in interface io.dropwizard.lifecycle.Managed
      Throws:
      Exception