Package io.micronaut.jms.listener
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.
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 Summary
ConstructorsConstructorDescriptionConcurrentMessageHandler(MessageHandler<T> delegate) Deprecated.Submits incoming handling requests on a single threaded executor to avoid blocking the main thread.ConcurrentMessageHandler(MessageHandler<T> delegate, ExecutorService executorService) Deprecated.Allows for concurrent handling of messages by handing of the logic to a delegateMessageHandlerbut wrapping those calls within anExecutor.execute(Runnable). -
Method Summary
-
Constructor Details
-
ConcurrentMessageHandler
Deprecated.Allows for concurrent handling of messages by handing of the logic to a delegateMessageHandlerbut wrapping those calls within anExecutor.execute(Runnable).- Parameters:
delegate- theMessageHandlerto actually handle the incoming messagesexecutorService- theExecutorServiceto submit handling requests to.
-
ConcurrentMessageHandler
Deprecated.Submits incoming handling requests on a single threaded executor to avoid blocking the main thread.- Parameters:
delegate- theMessageHandlerto actually handle the incoming messages/
-
-
Method Details
-
handle
Deprecated.Description copied from interface:MessageHandlerPerform some action when receiving a message.- Specified by:
handlein interfaceMessageHandler<T>- Parameters:
message- the message
-
shutdown
Deprecated.Closes the MessageHandler and terminates theexecutorService.- Returns:
- true if the
executorServiceis successfully shut down. - Throws:
InterruptedException- if there is a timeout waiting for the executor service to shut down
-