Package io.micronaut.jms.listener
Class JMSListenerContainer<T>
java.lang.Object
io.micronaut.jms.listener.JMSListenerContainer<T>
- Type Parameters:
T
- theMessage
object type to convert to before handling
Deprecated.
as of 2.1.1
Sets up and manages
MessageListener
s created by the
JMSListener
and
AbstractJMSListenerMethodProcessor
processing. There is support for programmatically instantiating listeners
however this has not been fully incorporated into a coherent API yet and has
not been fully tested. It is recommended to instead use the
JMSListener
annotation on existing classes.- Since:
- 1.0.0
- Author:
- Elliott Pope
-
Constructor Summary
ConstructorDescriptionJMSListenerContainer
(JMSConnectionPool connectionPool, JMSDestinationType type, int threadPoolSize) Deprecated.JMSListenerContainer
(JMSConnectionPool connectionPool, JMSDestinationType type, int threadPoolSize, int maxThreadPoolSize) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
registerListener
(String destination, MessageHandler<T> listener, Class<T> clazz) Deprecated.Registers aJMSListenerContainer
with default concurrency.void
registerListener
(String destination, javax.jms.MessageListener listener, Class<T> clazz, boolean transacted, int acknowledgeMode, Optional<String> messageSelector) Deprecated.Internal method used by theJMSListenerContainerFactory
for registering new listeners.boolean
shutdown()
Deprecated.Safely shuts down all open connections linked to the listener container.toString()
Deprecated.
-
Constructor Details
-
JMSListenerContainer
public JMSListenerContainer(JMSConnectionPool connectionPool, JMSDestinationType type, int threadPoolSize) Deprecated.- Parameters:
connectionPool
- theJMSConnectionPool
to pullConnection
s from to createMessageListener
stype
- eitherJMSDestinationType.QUEUE
orJMSDestinationType.TOPIC
.threadPoolSize
- the pool size
-
JMSListenerContainer
public JMSListenerContainer(JMSConnectionPool connectionPool, JMSDestinationType type, int threadPoolSize, int maxThreadPoolSize) Deprecated.- Parameters:
connectionPool
- theJMSConnectionPool
to pullConnection
s from to createMessageListener
stype
- eitherJMSDestinationType.QUEUE
orJMSDestinationType.TOPIC
.threadPoolSize
- the minimum core thread pool sizemaxThreadPoolSize
- the maximum number of threads to use handling incoming requests
-
-
Method Details
-
registerListener
Deprecated.Registers aJMSListenerContainer
with default concurrency.NOTE: this method is not recommended; instead use the annotation driven
JMSListener
- Parameters:
destination
- the queue or topic namelistener
- the message handlerclazz
- the message type
-
registerListener
public void registerListener(String destination, javax.jms.MessageListener listener, Class<T> clazz, boolean transacted, int acknowledgeMode, Optional<String> messageSelector) Deprecated.Internal method used by theJMSListenerContainerFactory
for registering new listeners.NOTE: this method is used internally by the
AbstractJMSListenerMethodProcessor
and is not recommended for use. Instead the annotation drivenJMSListener
is preferred.- Parameters:
destination
- the queue or topic namelistener
- the message handlerclazz
- the message typetransacted
- indicates whether the session will use a local transactionacknowledgeMode
- when transacted is false, indicates how messages received by the session will be acknowledgedmessageSelector
- the message selector for the listener- See Also:
-
Session.AUTO_ACKNOWLEDGE
Session.CLIENT_ACKNOWLEDGE
Session.DUPS_OK_ACKNOWLEDGE
-
shutdown
@PreDestroy public boolean shutdown()Deprecated.Safely shuts down all open connections linked to the listener container. To be executed when the bean is destroyed.- Returns:
- true if all open connections are successfully closed
-
toString
Deprecated.
-