Interface JmsMessageOperations
- All Superinterfaces:
- MessageReceivingOperations<Destination>, MessageRequestReplyOperations<Destination>, MessageSendingOperations<Destination>
- All Known Implementing Classes:
- JmsMessagingTemplate
public interface JmsMessageOperations
extends MessageSendingOperations<Destination>, MessageReceivingOperations<Destination>, MessageRequestReplyOperations<Destination>
A specialization of 
MessageSendingOperations, MessageReceivingOperations
and MessageRequestReplyOperations for JMS related operations that allow to
specify a destination name rather than the actual Destination.
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:
- 
Method SummaryModifier and TypeMethodDescriptionvoidconvertAndSend(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.<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 requestPostProcessor) 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.Receive a message from the given destination.<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(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(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.sendAndReceive(String destinationName, Message<?> requestMessage) Send a request message and receive the reply from the given destination.Methods inherited from interface MessageReceivingOperationsreceive, receive, receiveAndConvert, receiveAndConvertMethods inherited from interface MessageRequestReplyOperationsconvertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive, sendAndReceiveMethods inherited from interface MessageSendingOperationsconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, send
- 
Method Details- 
sendSend a message to the given destination.- Parameters:
- destinationName- the name of the target destination
- message- the message to send
- Throws:
- MessagingException
 
- 
convertAndSendConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message and send it to the given destination.- Parameters:
- destinationName- the name of the target destination
- payload- the Object to use as payload
- Throws:
- MessagingException
 
- 
convertAndSendvoid convertAndSend(String destinationName, Object payload, @Nullable Map<String, Object> headers) throws MessagingExceptionConvert 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.- 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
 
- 
convertAndSendvoid convertAndSend(String destinationName, Object payload, @Nullable MessagePostProcessor postProcessor) throws MessagingException 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.- 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
 
- 
convertAndSendvoid convertAndSend(String destinationName, Object payload, @Nullable Map<String, Object> headers, @Nullable MessagePostProcessor postProcessor) throws MessagingExceptionConvert 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.- 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
 
- 
receiveReceive a message from the given destination.- 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
 
- 
receiveAndConvert<T> @Nullable T receiveAndConvert(String destinationName, Class<T> targetClass) throws MessagingException Receive a message from the given destination and convert its payload to the specified target class.- 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
 
- 
receiveSelectedReceive a message from the default destination.- 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
- Since:
- 7.0
 
- 
receiveSelected@Nullable Message<?> receiveSelected(Destination destination, @Nullable String messageSelector) throws MessagingException Receive a message from the given destination.- 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
- Since:
- 7.0
 
- 
receiveSelected@Nullable Message<?> receiveSelected(String destinationName, @Nullable String messageSelector) throws MessagingException Receive a message from the given destination.- 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
- Since:
- 7.0
 
- 
receiveSelectedAndConvert<T> @Nullable T receiveSelectedAndConvert(@Nullable String messageSelector, Class<T> targetClass) throws MessagingException Receive a message from the default destination and convert its payload to the specified target class.- 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
- Since:
- 7.0
 
- 
receiveSelectedAndConvert<T> @Nullable T receiveSelectedAndConvert(Destination destination, @Nullable String messageSelector, Class<T> targetClass) throws MessagingException Receive a message from the given destination and convert its payload to the specified target class.- 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
- Since:
- 7.0
 
- 
receiveSelectedAndConvert<T> @Nullable T receiveSelectedAndConvert(String destinationName, @Nullable String messageSelector, Class<T> targetClass) throws MessagingException Receive a message from the given destination and convert its payload to the specified target class.- 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
- Since:
- 7.0
 
- 
sendAndReceive@Nullable Message<?> sendAndReceive(String destinationName, Message<?> requestMessage) throws MessagingException Send a request message and receive the reply from the given destination.- 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
 
- 
convertSendAndReceive<T> @Nullable T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass) throws MessagingException 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.- 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
 
- 
convertSendAndReceive<T> @Nullable T convertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass) throws MessagingExceptionConvert 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.- 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
 
- 
convertSendAndReceive<T> @Nullable T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, @Nullable MessagePostProcessor requestPostProcessor) throws MessagingException 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.- 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
 
- 
convertSendAndReceive<T> @Nullable T convertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass, @Nullable MessagePostProcessor requestPostProcessor) throws MessagingExceptionConvert 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.- 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
 
 
-