Class ConcurrentMessageHandler<T>

java.lang.Object
io.micronaut.jms.listener.ConcurrentMessageHandler<T>
Type Parameters:
T - the type of the object that the handler is expecting.
All Implemented Interfaces:
MessageHandler<T>

@Deprecated public class ConcurrentMessageHandler<T> extends Object implements MessageHandler<T>
Deprecated.
as of 2.1.1
A MessageHandler decorator that wraps a delegate implementation in an ExecutorService to handle many incoming messages concurrently on different threads. A default single-threaded executor is provided if no ExecutorService is provided.
Since:
1.0.0
Author:
Elliott Pope
  • Constructor Details

    • ConcurrentMessageHandler

      public ConcurrentMessageHandler(MessageHandler<T> delegate, ExecutorService executorService)
      Deprecated.
      Allows for concurrent handling of messages by handing of the logic to a delegate MessageHandler but wrapping those calls within an Executor.execute(Runnable).
      Parameters:
      delegate - the MessageHandler to actually handle the incoming messages
      executorService - the ExecutorService to submit handling requests to.
    • ConcurrentMessageHandler

      public ConcurrentMessageHandler(MessageHandler<T> delegate)
      Deprecated.
      Submits incoming handling requests on a single threaded executor to avoid blocking the main thread.
      Parameters:
      delegate - the MessageHandler to actually handle the incoming messages/
  • Method Details

    • handle

      public void handle(T message)
      Deprecated.
      Description copied from interface: MessageHandler
      Perform some action when receiving a message.
      Specified by:
      handle in interface MessageHandler<T>
      Parameters:
      message - the message
    • shutdown

      public boolean shutdown() throws InterruptedException
      Deprecated.
      Closes the MessageHandler and terminates the executorService.
      Returns:
      true if the executorService is successfully shut down.
      Throws:
      InterruptedException - if there is a timeout waiting for the executor service to shut down