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
ConstructorDescriptionConcurrentMessageHandler
(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 delegateMessageHandler
but 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 delegateMessageHandler
but wrapping those calls within anExecutor.execute(Runnable)
.- Parameters:
delegate
- theMessageHandler
to actually handle the incoming messagesexecutorService
- theExecutorService
to submit handling requests to.
-
ConcurrentMessageHandler
Deprecated.Submits incoming handling requests on a single threaded executor to avoid blocking the main thread.- Parameters:
delegate
- theMessageHandler
to actually handle the incoming messages/
-
-
Method Details
-
handle
Deprecated.Description copied from interface:MessageHandler
Perform some action when receiving a message.- Specified by:
handle
in interfaceMessageHandler<T>
- Parameters:
message
- the message
-
shutdown
Deprecated.Closes the MessageHandler and terminates theexecutorService
.- Returns:
- true if the
executorService
is successfully shut down. - Throws:
InterruptedException
- if there is a timeout waiting for the executor service to shut down
-