Implemented by JmsTemplate. Not often used but a useful option
to enhance testability, as it can easily be mocked or stubbed.
Provides JmsTemplate's send(..) and
receive(..) methods that mirror various JMS API methods.
See the JMS specification and javadocs for details on those methods.
Provides also basic request reply operation using a temporary queue to collect the reply.
JmsTemplate, jakarta.jms.Destination , jakarta.jms.Session , jakarta.jms.MessageProducer , jakarta.jms.MessageConsumer
| Modifier and Type | Method and Description |
|---|---|
| public <T> T | Returns: the result object from working with the sessioncallback object that exposes the session/browser pair action)Browse messages in the default JMS queue. |
| public <T> T | Returns: the result object from working with the sessionthe queue to browse queue, BrowserCallback<T> callback object that exposes the session/browser pair action)Browse messages in a JMS queue. |
| public <T> T | Returns: the result object from working with the sessionthe name of the queue to browse
(to be resolved to an actual destination by a DestinationResolver) queueName, BrowserCallback<T> callback object that exposes the session/browser pair action)Browse messages in a JMS queue. |
| public <T> T | Returns: the result object from working with the sessionthe JMS message selector expression (or messageSelector, BrowserCallback<T> null if none).
See the JMS specification for a detailed definition of selector expressions.callback object that exposes the session/browser pair action)Browse selected messages in a JMS queue. |
| public <T> T | Returns: the result object from working with the sessionthe queue to browse queue, String the JMS message selector expression (or messageSelector, BrowserCallback<T> null if none).
See the JMS specification for a detailed definition of selector expressions.callback object that exposes the session/browser pair action)Browse selected messages in a JMS queue. |
| public <T> T | Returns: the result object from working with the sessionthe name of the queue to browse
(to be resolved to an actual destination by a DestinationResolver) queueName, String the JMS message selector expression (or messageSelector, BrowserCallback<T> null if none).
See the JMS specification for a detailed definition of selector expressions.callback object that exposes the session/browser pair action)Browse selected messages in a JMS queue. |
| public void | convertAndSend(Object
the object to convert to a message message)Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. |
| public void | convertAndSend(Destination
the destination to send this message to destination, Object the object to convert to a message message)Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. |
| public void | convertAndSend(String
the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver) destinationName, Object the object to convert to a message message)Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. |
| public void | convertAndSend(Object
the object to convert to a message message, MessagePostProcessor the callback to modify the message postProcessor)Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. |
| public void | convertAndSend(Destination
the destination to send this message to destination, Object the object to convert to a message message, MessagePostProcessor the callback to modify the message postProcessor)Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. |
| public void | convertAndSend(String
the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver) destinationName, Object the object to convert to a message. message, MessagePostProcessor the callback to modify the message postProcessor)Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. |
| public <T> T | Returns: the result object from working with the sessioncallback object that exposes the session action)Execute the action specified by the given action object within a JMS Session. |
| public <T> T | Returns: the result object from working with the sessioncallback object that exposes the session/producer pair action)Send messages to the default JMS destination (or one specified for each send operation). |
| public <T> T | Returns: the result object from working with the sessionthe destination to send messages to destination, ProducerCallback<T> callback object that exposes the session/producer pair action)Send messages to a JMS destination. |
| public <T> T | Returns: the result object from working with the sessionthe name of the destination to send messages to
(to be resolved to an actual destination by a DestinationResolver) destinationName, ProducerCallback<T> callback object that exposes the session/producer pair action)Send messages to a JMS destination. |
| public Message | Returns: the message received by the consumer, ornull if the timeout expiresReceive a message synchronously from the default destination, but only wait up to a specified time for delivery. |
| public Message | Returns: the message received by the consumer, ornull if the timeout expiresthe destination to receive a message from destination)Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
| public Message | Returns: the message received by the consumer, ornull if the timeout expiresthe name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver) destinationName)Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
| public Object | Returns: the message produced for the consumer ornull if the timeout expires.Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. |
| public Object | Returns: the message produced for the consumer ornull if the timeout expires.the destination to receive a message from destination)Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
| public Object | Returns: the message produced for the consumer ornull if the timeout expires.the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver) destinationName)Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
| public Message | Returns: the message received by the consumer, ornull if the timeout expiresthe JMS message selector expression (or messageSelector)null if none).
See the JMS specification for a detailed definition of selector expressions.Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. |
| public Message | Returns: the message received by the consumer, ornull if the timeout expiresthe destination to receive a message from destination, String the JMS message selector expression (or messageSelector)null if none).
See the JMS specification for a detailed definition of selector expressions.Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
| public Message | Returns: the message received by the consumer, ornull if the timeout expiresthe name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver) destinationName, String the JMS message selector expression (or messageSelector)null if none).
See the JMS specification for a detailed definition of selector expressions.Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
| public Object | Returns: the message produced for the consumer ornull if the timeout expires.the JMS message selector expression (or messageSelector)null if none).
See the JMS specification for a detailed definition of selector expressions.Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. |
| public Object | Returns: the message produced for the consumer ornull if the timeout expires.the destination to receive a message from destination, String the JMS message selector expression (or messageSelector)null if none).
See the JMS specification for a detailed definition of selector expressions.Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
| public Object | Returns: the message produced for the consumer ornull if the timeout expires.the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver) destinationName, String the JMS message selector expression (or messageSelector)null if none).
See the JMS specification for a detailed definition of selector expressions.Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
| public void | send(MessageCreator
callback to create a message messageCreator)Send a message to the default destination. |
| public void | send(Destination
the destination to send this message to destination, MessageCreator callback to create a message messageCreator)Send a message to the specified destination. |
| public void | send(String
the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver) destinationName, MessageCreator callback to create a message messageCreator)Send a message to the specified destination. |
| public Message | Returns: the reply, possiblynull if the message could not be received,
for example due to a timeoutcallback to create a request message messageCreator)Send a request message and receive the reply from a default destination. |
| public Message | Returns: the reply, possiblynull if the message could not be received,
for example due to a timeoutthe destination to send this message to destination, MessageCreator callback to create a message messageCreator)Send a message and receive the reply from the specified destination. |
| public Message | Returns: the reply, possiblynull if the message could not be received,
for example due to a timeoutthe name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver) destinationName, MessageCreator callback to create a message messageCreator)Send a message and receive the reply from the specified destination. |
| browse | back to summary |
|---|---|
| public <T> T browse(BrowserCallback<T> action) throws JmsException Browse messages in the default JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
| |
| browse | back to summary |
|---|---|
| public <T> T browse(Queue queue, BrowserCallback<T> action) throws JmsException Browse messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
| |
| browse | back to summary |
|---|---|
| public <T> T browse(String queueName, BrowserCallback<T> action) throws JmsException Browse messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
| |
| browseSelected | back to summary |
|---|---|
| public <T> T browseSelected(String messageSelector, BrowserCallback<T> action) throws JmsException Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
| |
| browseSelected | back to summary |
|---|---|
| public <T> T browseSelected(Queue queue, String messageSelector, BrowserCallback<T> action) throws JmsException Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
| |
| browseSelected | back to summary |
|---|---|
| public <T> T browseSelected(String queueName, String messageSelector, BrowserCallback<T> action) throws JmsException Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
| |
| convertAndSend | back to summary |
|---|---|
| public void convertAndSend(Object message) throws JmsException Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. This will only work with a default destination specified!
| |
| convertAndSend | back to summary |
|---|---|
| public void convertAndSend(Destination destination, Object message) throws JmsException Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
| |
| convertAndSend | back to summary |
|---|---|
| public void convertAndSend(String destinationName, Object message) throws JmsException Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
| |
| convertAndSend | back to summary |
|---|---|
| public void convertAndSend(Object message, MessagePostProcessor postProcessor) throws JmsException Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion. This will only work with a default destination specified!
| |
| convertAndSend | back to summary |
|---|---|
| public void convertAndSend(Destination destination, Object message, MessagePostProcessor postProcessor) throws JmsException Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.
| |
| convertAndSend | back to summary |
|---|---|
| public void convertAndSend(String destinationName, Object message, MessagePostProcessor postProcessor) throws JmsException Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.
| |
| execute | back to summary |
|---|---|
| public <T> T execute(SessionCallback<T> action) throws JmsException Execute the action specified by the given action object within a JMS Session.
| |
| execute | back to summary |
|---|---|
| public <T> T execute(ProducerCallback<T> action) throws JmsException Send messages to the default JMS destination (or one specified for each send operation). The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.
| |
| execute | back to summary |
|---|---|
| public <T> T execute(Destination destination, ProducerCallback<T> action) throws JmsException Send messages to a JMS destination. The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.
| |
| execute | back to summary |
|---|---|
| public <T> T execute(String destinationName, ProducerCallback<T> action) throws JmsException Send messages to a JMS destination. The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.
| |
| receive | back to summary |
|---|---|
| public Message receive() throws JmsException Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded. This will only work with a default destination specified!
| |
| receive | back to summary |
|---|---|
| public Message receive(Destination destination) throws JmsException Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
| |
| receive | back to summary |
|---|---|
| public Message receive(String destinationName) throws JmsException Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
| |
| receiveAndConvert | back to summary |
|---|---|
| public Object receiveAndConvert() throws JmsException Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded. This will only work with a default destination specified!
| |
| receiveAndConvert | back to summary |
|---|---|
| public Object receiveAndConvert(Destination destination) throws JmsException Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
| |
| receiveAndConvert | back to summary |
|---|---|
| public Object receiveAndConvert(String destinationName) throws JmsException Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
| |
| receiveSelected | back to summary |
|---|---|
| public Message receiveSelected(String messageSelector) throws JmsException Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded. This will only work with a default destination specified!
| |
| receiveSelected | back to summary |
|---|---|
| public Message receiveSelected(Destination destination, String messageSelector) throws JmsException Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
| |
| receiveSelected | back to summary |
|---|---|
| public Message receiveSelected(String destinationName, String messageSelector) throws JmsException Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
| |
| receiveSelectedAndConvert | back to summary |
|---|---|
| public Object receiveSelectedAndConvert(String messageSelector) throws JmsException Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded. This will only work with a default destination specified!
| |
| receiveSelectedAndConvert | back to summary |
|---|---|
| public Object receiveSelectedAndConvert(Destination destination, String messageSelector) throws JmsException Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
| |
| receiveSelectedAndConvert | back to summary |
|---|---|
| public Object receiveSelectedAndConvert(String destinationName, String messageSelector) throws JmsException Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter. This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
| |
| send | back to summary |
|---|---|
| public void send(MessageCreator messageCreator) throws JmsException Send a message to the default destination. This will only work with a default destination specified!
| |
| send | back to summary |
|---|---|
| public void send(Destination destination, MessageCreator messageCreator) throws JmsException Send a message to the specified destination. The MessageCreator callback creates the message given a Session.
| |
| send | back to summary |
|---|---|
| public void send(String destinationName, MessageCreator messageCreator) throws JmsException Send a message to the specified destination. The MessageCreator callback creates the message given a Session.
| |
| sendAndReceive | back to summary |
|---|---|
| public Message sendAndReceive(MessageCreator messageCreator) throws JmsException Send a request message and receive the reply from a default destination. The
This will only work with a default destination specified!
| |
| sendAndReceive | back to summary |
|---|---|
| public Message sendAndReceive(Destination destination, MessageCreator messageCreator) throws JmsException Send a message and receive the reply from the specified destination. The
| |
| sendAndReceive | back to summary |
|---|---|
| public Message sendAndReceive(String destinationName, MessageCreator messageCreator) throws JmsException Send a message and receive the reply from the specified destination. The
| |