Class JmsMessagingTemplate
java.lang.Object
org.springframework.messaging.core.AbstractMessageSendingTemplate<jakarta.jms.Destination>
org.springframework.messaging.core.AbstractMessageReceivingTemplate<jakarta.jms.Destination>
org.springframework.messaging.core.AbstractMessagingTemplate<jakarta.jms.Destination>
org.springframework.jms.core.JmsMessagingTemplate
- All Implemented Interfaces:
- InitializingBean, JmsMessageOperations, MessageReceivingOperations<jakarta.jms.Destination>, MessageRequestReplyOperations<jakarta.jms.Destination>, MessageSendingOperations<jakarta.jms.Destination>
public class JmsMessagingTemplate
extends AbstractMessagingTemplate<jakarta.jms.Destination>
implements JmsMessageOperations, InitializingBean
An implementation of 
JmsMessageOperations, as a wrapper on top of Spring's
traditional JmsTemplate. Aligned with the spring-messaging module
and GenericMessagingTemplate.
Note: Operations in this interface throw MessagingException instead of
the JMS-specific JmsException, aligning with the
spring-messaging module and its other client operation handles.
- Since:
- 4.1
- Author:
- Stephane Nicoll, Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class AbstractMessageSendingTemplateCONVERSION_HINT_HEADER, logger
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor for use with bean properties.JmsMessagingTemplate(jakarta.jms.ConnectionFactory connectionFactory) Create aJmsMessagingTemplateinstance with the JMSConnectionFactoryto use, implicitly building aJmsTemplatebased on it.JmsMessagingTemplate(JmsOperations jmsTemplate) Create aJmsMessagingTemplateinstance with theJmsOperationsto use.JmsMessagingTemplate(JmsTemplate jmsTemplate) Create aJmsMessagingTemplateinstance with theJmsTemplateto use.
- 
Method SummaryModifier and TypeMethodDescriptionvoidInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.voidconvertAndSend(Object payload, @Nullable Map<String, Object> headers, @Nullable MessagePostProcessor postProcessor) Convert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post-processor, and send the resulting message to the given destination.voidconvertAndSend(String destinationName, Object payload) Convert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message and send it to the given destination.voidConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers and send it to the given destination.voidconvertAndSend(String destinationName, Object payload, @Nullable Map<String, Object> headers, @Nullable MessagePostProcessor postProcessor) Convert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post-processor, and send the resulting message to the given destination.voidconvertAndSend(String destinationName, Object payload, @Nullable MessagePostProcessor postProcessor) Convert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message, apply the given post-processor, and send the resulting message to the given destination.protected MessagingExceptionconvertJmsMessage(@Nullable jakarta.jms.Message message) <T> @Nullable TconvertSendAndReceive(Object request, Class<T> targetClass) Convert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto a default destination, receive the reply and convert its body of the specified target class.<T> @Nullable TconvertSendAndReceive(Object request, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor) Convert the given request Object to serialized form, possibly using aMessageConverter, apply the given post-processor and send the resultingMessageto a default destination, receive the reply and convert its body of the given target class.<T> @Nullable TconvertSendAndReceive(String destinationName, Object request, Class<T> targetClass) Convert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto the given destination, receive the reply and convert its body of the specified target class.<T> @Nullable TconvertSendAndReceive(String destinationName, Object request, Class<T> targetClass, @Nullable MessagePostProcessor requestPostProcessor) Convert the given request Object to serialized form, possibly using aMessageConverter, apply the given post-processor and send the resultingMessageto the given destination, receive the reply and convert its body of the given target class.<T> @Nullable TconvertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass) Convert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessagewith the given headers, to the specified destination, receive the reply and convert its body of the specified target class.<T> @Nullable TconvertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor) Convert the given request Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post-processor and send the resultingMessageto the specified destination, receive the reply and convert its body of the given target class.doReceive(jakarta.jms.Destination destination) Actually receive a message from the given destination.doReceiveSelected(jakarta.jms.Destination destination, @Nullable String messageSelector) doReceiveSelected(String destinationName, @Nullable String messageSelector) protected voidActually send the given message to the given destination.protected voiddoSendAndReceive(jakarta.jms.Destination destination, Message<?> requestMessage) Actually send the given request message to the given destination and receive a reply message for it.doSendAndReceive(String destinationName, Message<?> requestMessage) @Nullable jakarta.jms.ConnectionFactoryReturn the ConnectionFactory that the underlyingJmsTemplateuses.Return the configured default destination name.Return the configuredJmsTemplate.protected Stringreceive()Receive a message from a default destination.Receive a message from the given destination.<T> @Nullable TreceiveAndConvert(Class<T> targetClass) Receive a message from a default destination and convert its payload to the specified target class.<T> @Nullable TreceiveAndConvert(String destinationName, Class<T> targetClass) Receive a message from the given destination and convert its payload to the specified target class.receiveSelected(jakarta.jms.Destination destination, @Nullable String messageSelector) Receive a message from the given destination.receiveSelected(@Nullable String messageSelector) Receive a message from the default destination.receiveSelected(String destinationName, @Nullable String messageSelector) Receive a message from the given destination.<T> @Nullable TreceiveSelectedAndConvert(jakarta.jms.Destination destination, @Nullable String messageSelector, Class<T> targetClass) Receive a message from the given destination and convert its payload to the specified target class.<T> @Nullable TreceiveSelectedAndConvert(@Nullable String messageSelector, Class<T> targetClass) Receive a message from the default destination and convert its payload to the specified target class.<T> @Nullable TreceiveSelectedAndConvert(String destinationName, @Nullable String messageSelector, Class<T> targetClass) Receive a message from the given destination and convert its payload to the specified target class.voidSend a message to the given destination.voidSend a message to a default destination.sendAndReceive(String destinationName, Message<?> requestMessage) Send a request message and receive the reply from the given destination.sendAndReceive(Message<?> requestMessage) Send a request message and receive the reply from a default destination.voidsetConnectionFactory(jakarta.jms.ConnectionFactory connectionFactory) Set the ConnectionFactory to use for the underlyingJmsTemplate.voidsetDefaultDestinationName(@Nullable String defaultDestinationName) Configure the default destination name to use in send methods that don't have a destination argument.voidsetJmsMessageConverter(MessageConverter jmsMessageConverter) voidsetJmsTemplate(@Nullable JmsTemplate jmsTemplate) Set theJmsTemplateto use.Methods inherited from class AbstractMessagingTemplateconvertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceiveMethods inherited from class AbstractMessageReceivingTemplatedoConvert, receive, receiveAndConvertMethods inherited from class AbstractMessageSendingTemplateconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, setDefaultDestination, setMessageConverterMethods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MessageReceivingOperationsreceive, receiveAndConvertMethods inherited from interface MessageRequestReplyOperationsconvertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceiveMethods inherited from interface MessageSendingOperationsconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send
- 
Constructor Details- 
JmsMessagingTemplatepublic JmsMessagingTemplate()Constructor for use with bean properties. RequiressetConnectionFactory(ConnectionFactory)orsetJmsTemplate(JmsTemplate)to be called.
- 
JmsMessagingTemplatepublic JmsMessagingTemplate(jakarta.jms.ConnectionFactory connectionFactory) Create aJmsMessagingTemplateinstance with the JMSConnectionFactoryto use, implicitly building aJmsTemplatebased on it.- Since:
- 4.1.2
 
- 
JmsMessagingTemplateCreate aJmsMessagingTemplateinstance with theJmsTemplateto use.
- 
JmsMessagingTemplateCreate aJmsMessagingTemplateinstance with theJmsOperationsto use.- Since:
- 7.0
 
 
- 
- 
Method Details- 
setConnectionFactorypublic void setConnectionFactory(jakarta.jms.ConnectionFactory connectionFactory) Set the ConnectionFactory to use for the underlyingJmsTemplate.- Since:
- 4.1.2
 
- 
getConnectionFactoryReturn the ConnectionFactory that the underlyingJmsTemplateuses.- Since:
- 4.1.2
 
- 
setJmsTemplateSet theJmsTemplateto use.
- 
getJmsTemplateReturn the configuredJmsTemplate.
- 
setJmsMessageConverterSet theMessageConverterto use to convert aMessageto and from aMessage.By default, a MessagingMessageConverteris defined using aSimpleMessageConverterto convert the payload of the message.Consider configuring a MessagingMessageConverterwith a differentpayload converterfor more advanced scenarios.- See Also:
 
- 
getJmsMessageConverter
- 
setDefaultDestinationNameConfigure the default destination name to use in send methods that don't have a destination argument. If a default destination is not configured, send methods without a destination argument will raise an exception if invoked.- See Also:
 
- 
getDefaultDestinationName
- 
afterPropertiesSetpublic void afterPropertiesSet()Description copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set. - Specified by:
- afterPropertiesSetin interface- InitializingBean
 
- 
sendDescription copied from interface:MessageSendingOperationsSend a message to a default destination.- Specified by:
- sendin interface- MessageSendingOperations<jakarta.jms.Destination>
- Overrides:
- sendin class- AbstractMessageSendingTemplate<jakarta.jms.Destination>
- Parameters:
- message- the message to send
- Throws:
- MessagingException
 
- 
convertAndSendpublic void convertAndSend(Object payload, @Nullable Map<String, Object> headers, @Nullable MessagePostProcessor postProcessor) throws MessagingExceptionDescription copied from interface:MessageSendingOperationsConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post-processor, and send the resulting message to the given destination.- Specified by:
- convertAndSendin interface- MessageSendingOperations<jakarta.jms.Destination>
- Overrides:
- convertAndSendin class- AbstractMessageSendingTemplate<jakarta.jms.Destination>
- Parameters:
- payload- the Object to use as payload
- headers- the headers for the message to send
- postProcessor- the post-processor to apply to the message
- Throws:
- MessagingException
 
- 
sendDescription copied from interface:JmsMessageOperationsSend a message to the given destination.- Specified by:
- sendin interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- message- the message to send
- Throws:
- MessagingException
 
- 
convertAndSendDescription copied from interface:JmsMessageOperationsConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message and send it to the given destination.- Specified by:
- convertAndSendin interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- payload- the Object to use as payload
- Throws:
- MessagingException
 
- 
convertAndSendpublic void convertAndSend(String destinationName, Object payload, @Nullable Map<String, Object> headers) throws MessagingExceptionDescription copied from interface:JmsMessageOperationsConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers and send it to the given destination.- Specified by:
- convertAndSendin interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- payload- the Object to use as payload
- headers- the headers for the message to send
- Throws:
- MessagingException
 
- 
convertAndSendpublic void convertAndSend(String destinationName, Object payload, @Nullable MessagePostProcessor postProcessor) throws MessagingException Description copied from interface:JmsMessageOperationsConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message, apply the given post-processor, and send the resulting message to the given destination.- Specified by:
- convertAndSendin interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- payload- the Object to use as payload
- postProcessor- the post-processor to apply to the message
- Throws:
- MessagingException
 
- 
convertAndSendpublic void convertAndSend(String destinationName, Object payload, @Nullable Map<String, Object> headers, @Nullable MessagePostProcessor postProcessor) throws MessagingExceptionDescription copied from interface:JmsMessageOperationsConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post-processor, and send the resulting message to the given destination.- Specified by:
- convertAndSendin interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- payload- the Object to use as payload
- headers- the headers for the message to send
- postProcessor- the post-processor to apply to the message
- Throws:
- MessagingException
 
- 
receiveDescription copied from interface:MessageReceivingOperationsReceive a message from a default destination.- Specified by:
- receivein interface- MessageReceivingOperations<jakarta.jms.Destination>
- Overrides:
- receivein class- AbstractMessageReceivingTemplate<jakarta.jms.Destination>
- Returns:
- the received message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveAndConvertDescription copied from interface:MessageReceivingOperationsReceive a message from a default destination and convert its payload to the specified target class.- Specified by:
- receiveAndConvertin interface- MessageReceivingOperations<jakarta.jms.Destination>
- Overrides:
- receiveAndConvertin class- AbstractMessageReceivingTemplate<jakarta.jms.Destination>
- Parameters:
- targetClass- the target class to convert the payload to
- Returns:
- the converted payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveDescription copied from interface:JmsMessageOperationsReceive a message from the given destination.- Specified by:
- receivein interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- Returns:
- the received message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveAndConvertpublic <T> @Nullable T receiveAndConvert(String destinationName, Class<T> targetClass) throws MessagingException Description copied from interface:JmsMessageOperationsReceive a message from the given destination and convert its payload to the specified target class.- Specified by:
- receiveAndConvertin interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- targetClass- the target class to convert the payload to
- Returns:
- the converted payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveSelectedpublic @Nullable Message<?> receiveSelected(@Nullable String messageSelector) throws MessagingException Description copied from interface:JmsMessageOperationsReceive a message from the default destination.- Specified by:
- receiveSelectedin interface- JmsMessageOperations
- Parameters:
- messageSelector- the JMS message selector expression (or- nullif none). See the JMS specification for a detailed definition of selector expressions.
- Returns:
- the received message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveSelectedpublic @Nullable Message<?> receiveSelected(jakarta.jms.Destination destination, @Nullable String messageSelector) throws MessagingException Description copied from interface:JmsMessageOperationsReceive a message from the given destination.- Specified by:
- receiveSelectedin interface- JmsMessageOperations
- Parameters:
- destination- the target destination
- messageSelector- the JMS message selector expression (or- nullif none). See the JMS specification for a detailed definition of selector expressions.
- Returns:
- the received message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveSelectedpublic @Nullable Message<?> receiveSelected(String destinationName, @Nullable String messageSelector) throws MessagingException Description copied from interface:JmsMessageOperationsReceive a message from the given destination.- Specified by:
- receiveSelectedin interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- messageSelector- the JMS message selector expression (or- nullif none). See the JMS specification for a detailed definition of selector expressions.
- Returns:
- the received message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveSelectedAndConvertpublic <T> @Nullable T receiveSelectedAndConvert(@Nullable String messageSelector, Class<T> targetClass) throws MessagingException Description copied from interface:JmsMessageOperationsReceive a message from the default destination and convert its payload to the specified target class.- Specified by:
- receiveSelectedAndConvertin interface- JmsMessageOperations
- Parameters:
- messageSelector- the JMS message selector expression (or- nullif none). See the JMS specification for a detailed definition of selector expressions.
- targetClass- the target class to convert the payload to
- Returns:
- the converted payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveSelectedAndConvertpublic <T> @Nullable T receiveSelectedAndConvert(jakarta.jms.Destination destination, @Nullable String messageSelector, Class<T> targetClass) throws MessagingException Description copied from interface:JmsMessageOperationsReceive a message from the given destination and convert its payload to the specified target class.- Specified by:
- receiveSelectedAndConvertin interface- JmsMessageOperations
- Parameters:
- destination- the target destination
- messageSelector- the JMS message selector expression (or- nullif none). See the JMS specification for a detailed definition of selector expressions.
- targetClass- the target class to convert the payload to
- Returns:
- the converted payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveSelectedAndConvertpublic <T> @Nullable T receiveSelectedAndConvert(String destinationName, @Nullable String messageSelector, Class<T> targetClass) throws MessagingException Description copied from interface:JmsMessageOperationsReceive a message from the given destination and convert its payload to the specified target class.- Specified by:
- receiveSelectedAndConvertin interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- messageSelector- the JMS message selector expression (or- nullif none). See the JMS specification for a detailed definition of selector expressions.
- targetClass- the target class to convert the payload to
- Returns:
- the converted payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
sendAndReceiveDescription copied from interface:MessageRequestReplyOperationsSend a request message and receive the reply from a default destination.- Specified by:
- sendAndReceivein interface- MessageRequestReplyOperations<jakarta.jms.Destination>
- Overrides:
- sendAndReceivein class- AbstractMessagingTemplate<jakarta.jms.Destination>
- Parameters:
- requestMessage- the message to send
- Returns:
- the reply, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
sendAndReceivepublic @Nullable Message<?> sendAndReceive(String destinationName, Message<?> requestMessage) throws MessagingException Description copied from interface:JmsMessageOperationsSend a request message and receive the reply from the given destination.- Specified by:
- sendAndReceivein interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- requestMessage- the message to send
- Returns:
- the reply, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
convertSendAndReceivepublic <T> @Nullable T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass) throws MessagingException Description copied from interface:JmsMessageOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto the given destination, receive the reply and convert its body of the specified target class.- Specified by:
- convertSendAndReceivein interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- request- payload for the request message to send
- targetClass- the target type to convert the payload of the reply to
- Returns:
- the payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
convertSendAndReceivepublic <T> @Nullable T convertSendAndReceive(Object request, Class<T> targetClass) throws MessagingException Description copied from interface:MessageRequestReplyOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto a default destination, receive the reply and convert its body of the specified target class.- Specified by:
- convertSendAndReceivein interface- MessageRequestReplyOperations<jakarta.jms.Destination>
- Overrides:
- convertSendAndReceivein class- AbstractMessagingTemplate<jakarta.jms.Destination>
- Parameters:
- request- payload for the request message to send
- targetClass- the target type to convert the payload of the reply to
- Returns:
- the payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
convertSendAndReceivepublic <T> @Nullable T convertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass) throws MessagingExceptionDescription copied from interface:JmsMessageOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessagewith the given headers, to the specified destination, receive the reply and convert its body of the specified target class.- Specified by:
- convertSendAndReceivein interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- request- payload for the request message to send
- headers- the headers for the request message to send
- targetClass- the target type to convert the payload of the reply to
- Returns:
- the payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
convertSendAndReceivepublic <T> @Nullable T convertSendAndReceive(Object request, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor) throws MessagingException Description copied from interface:MessageRequestReplyOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, apply the given post-processor and send the resultingMessageto a default destination, receive the reply and convert its body of the given target class.- Specified by:
- convertSendAndReceivein interface- MessageRequestReplyOperations<jakarta.jms.Destination>
- Overrides:
- convertSendAndReceivein class- AbstractMessagingTemplate<jakarta.jms.Destination>
- Parameters:
- request- payload for the request message to send
- targetClass- the target type to convert the payload of the reply to
- postProcessor- post-process to apply to the request message
- Returns:
- the payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
convertSendAndReceivepublic <T> @Nullable T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, @Nullable MessagePostProcessor requestPostProcessor) throws MessagingException Description copied from interface:JmsMessageOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, apply the given post-processor and send the resultingMessageto the given destination, receive the reply and convert its body of the given target class.- Specified by:
- convertSendAndReceivein interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- request- payload for the request message to send
- targetClass- the target type to convert the payload of the reply to
- requestPostProcessor- post-process to apply to the request message
- Returns:
- the payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
convertSendAndReceivepublic <T> @Nullable T convertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor) throws MessagingExceptionDescription copied from interface:JmsMessageOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post-processor and send the resultingMessageto the specified destination, receive the reply and convert its body of the given target class.- Specified by:
- convertSendAndReceivein interface- JmsMessageOperations
- Parameters:
- destinationName- the name of the target destination
- request- payload for the request message to send
- targetClass- the target type to convert the payload of the reply to
- postProcessor- post-process to apply to the request message
- Returns:
- the payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
doSendDescription copied from class:AbstractMessageSendingTemplateActually send the given message to the given destination.- Specified by:
- doSendin class- AbstractMessageSendingTemplate<jakarta.jms.Destination>
- Parameters:
- destination- the target destination
- message- the message to send
 
- 
doSend
- 
doReceiveDescription copied from class:AbstractMessageReceivingTemplateActually receive a message from the given destination.- Specified by:
- doReceivein class- AbstractMessageReceivingTemplate<jakarta.jms.Destination>
- Parameters:
- destination- the target destination
- Returns:
- the received message, possibly nullif the message could not be received, for example due to a timeout
 
- 
doReceive
- 
doReceiveSelected
- 
doReceiveSelected
- 
doSendAndReceiveprotected @Nullable Message<?> doSendAndReceive(jakarta.jms.Destination destination, Message<?> requestMessage) Description copied from class:AbstractMessagingTemplateActually send the given request message to the given destination and receive a reply message for it.- Specified by:
- doSendAndReceivein class- AbstractMessagingTemplate<jakarta.jms.Destination>
- Parameters:
- destination- the target destination
- requestMessage- the message to send
- Returns:
- the received reply, possibly nullif the message could not be received, for example due to a timeout
 
- 
doSendAndReceive
- 
getRequiredDefaultDestinationName
- 
convertJmsMessage
- 
convertJmsException
 
-