Top Description Methods
org.springframework.jms.core

public Interface JmsMessageOperations

extends MessageSendingOperations<Destination>, MessageReceivingOperations<Destination>, MessageRequestReplyOperations<Destination>
Known Direct Implementers
org.springframework.jms.core.JmsMessagingTemplate
Imports
java.util.Map, jakarta.jms.Destination, org.springframework.lang.Nullable, org.springframework.messaging.Message, .MessagingException, org.springframework.messaging.core.MessagePostProcessor, .MessageReceivingOperations, .MessageRequestReplyOperations, .MessageSendingOperations

A specialization of MessageSendingOperations, MessageReceivingOperations and MessageRequestReplyOperations for JMS related operations that allow to specify a destination name rather than the actual jakarta.jms.Destination.
Author
Stephane Nicoll
Since
4.1
See Also
org.springframework.jms.core.JmsTemplate, org.springframework.messaging.core.MessageSendingOperations, org.springframework.messaging.core.MessageReceivingOperations, org.springframework.messaging.core.MessageRequestReplyOperations

Method Summary

Modifier and TypeMethod and Description
public void
convertAndSend(String
the name of the target destination
destinationName
,
Object
the Object to use as payload
payload
)

Redeclares org.springframework.messaging.core.MessageSendingOperations.convertAndSend.

Convert the given Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message and send it to the given destination.

public void
convertAndSend(String
the name of the target destination
destinationName
,
Object
the Object to use as payload
payload
,
Map<String, Object>
the headers for the message to send
headers
)

Redeclares org.springframework.messaging.core.MessageSendingOperations.convertAndSend.

Convert the given Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers and send it to the given destination.

public void
convertAndSend(String
the name of the target destination
destinationName
,
Object
the Object to use as payload
payload
,
MessagePostProcessor
the post processor to apply to the message
postProcessor
)

Redeclares org.springframework.messaging.core.MessageSendingOperations.convertAndSend.

Convert the given Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message, apply the given post processor, and send the resulting message to the given destination.

public void
convertAndSend(String
the name of the target destination
destinationName
,
Object
the Object to use as payload
payload
,
Map<String, Object>
the headers for the message to send
headers
,
MessagePostProcessor
the post processor to apply to the message
postProcessor
)

Redeclares org.springframework.messaging.core.MessageSendingOperations.convertAndSend.

Convert the given Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post processor, and send the resulting message to the given destination.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(String
the name of the target destination
destinationName
,
Object
payload for the request message to send
request
,
Class<T>
the target type to convert the payload of the reply to
targetClass
)

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message to the given destination, receive the reply and convert its body of the specified target class.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(String
the name of the target destination
destinationName
,
Object
payload for the request message to send
request
,
Map<String, Object>
the headers for the request message to send
headers
,
Class<T>
the target type to convert the payload of the reply to
targetClass
)

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(String
the name of the target destination
destinationName
,
Object
payload for the request message to send
request
,
Class<T>
the target type to convert the payload of the reply to
targetClass
,
MessagePostProcessor
post process to apply to the request message
requestPostProcessor
)

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, apply the given post processor and send the resulting Message to the given destination, receive the reply and convert its body of the given target class.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(String
the name of the target destination
destinationName
,
Object
payload for the request message to send
request
,
Map<String, Object> headers, Class<T>
the target type to convert the payload of the reply to
targetClass
,
MessagePostProcessor
post process to apply to the request message
requestPostProcessor
)

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resulting Message to the specified destination, receive the reply and convert its body of the given target class.

public Message<?>

Returns:

the received message, possibly null if the message could not be received, for example due to a timeout
receive
(String
the name of the target destination
destinationName
)

Redeclares org.springframework.messaging.core.MessageReceivingOperations.receive.

Receive a message from the given destination.

public <T> T

Returns:

the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout
receiveAndConvert
(String
the name of the target destination
destinationName
,
Class<T>
the target class to convert the payload to
targetClass
)

Redeclares org.springframework.messaging.core.MessageReceivingOperations.receiveAndConvert.

Receive a message from the given destination and convert its payload to the specified target class.

public void
send(String
the name of the target destination
destinationName
,
Message<?>
the message to send
message
)

Redeclares org.springframework.messaging.core.MessageSendingOperations.send.

Send a message to the given destination.

public Message<?>

Returns:

the reply, possibly null if the message could not be received, for example due to a timeout
sendAndReceive
(String
the name of the target destination
destinationName
,
Message<?>
the message to send
requestMessage
)

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

Send a request message and receive the reply from the given destination.

Inherited from org.springframework.messaging.core.MessageReceivingOperations:
receivereceiveAndConvert
Inherited from org.springframework.messaging.core.MessageRequestReplyOperations:
convertSendAndReceiveconvertSendAndReceivesendAndReceive
Inherited from org.springframework.messaging.core.MessageSendingOperations:
convertAndSendconvertAndSendsend

Method Detail

convertAndSendback to summary
public void convertAndSend(String destinationName, Object payload) throws MessagingException

Redeclares org.springframework.messaging.core.MessageSendingOperations.convertAndSend.

Convert the given Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message and send it to the given destination.

Parameters
destinationName:String

the name of the target destination

payload:Object

the Object to use as payload

convertAndSendback to summary
public void convertAndSend(String destinationName, Object payload, Map<String, Object> headers) throws MessagingException

Redeclares org.springframework.messaging.core.MessageSendingOperations.convertAndSend.

Convert the given Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers and send it to the given destination.

Parameters
destinationName:String

the name of the target destination

payload:Object

the Object to use as payload

headers:Map<String, Object>

the headers for the message to send

convertAndSendback to summary
public void convertAndSend(String destinationName, Object payload, MessagePostProcessor postProcessor) throws MessagingException

Redeclares org.springframework.messaging.core.MessageSendingOperations.convertAndSend.

Convert the given Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message, apply the given post processor, and send the resulting message to the given destination.

Parameters
destinationName:String

the name of the target destination

payload:Object

the Object to use as payload

postProcessor:MessagePostProcessor

the post processor to apply to the message

convertAndSendback to summary
public void convertAndSend(String destinationName, Object payload, Map<String, Object> headers, MessagePostProcessor postProcessor) throws MessagingException

Redeclares org.springframework.messaging.core.MessageSendingOperations.convertAndSend.

Convert the given Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, 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:String

the name of the target destination

payload:Object

the Object to use as payload

headers:Map<String, Object>

the headers for the message to send

postProcessor:MessagePostProcessor

the post processor to apply to the message

convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass) throws MessagingException

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message to the given destination, receive the reply and convert its body of the specified target class.

Parameters
destinationName:String

the name of the target destination

request:Object

payload for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(String destinationName, Object request, Map<String, Object> headers, Class<T> targetClass) throws MessagingException

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.

Parameters
destinationName:String

the name of the target destination

request:Object

payload for the request message to send

headers:Map<String, Object>

the headers for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, apply the given post processor and send the resulting Message to the given destination, receive the reply and convert its body of the given target class.

Parameters
destinationName:String

the name of the target destination

request:Object

payload for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

requestPostProcessor:MessagePostProcessor

post process to apply to the request message

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(String destinationName, Object request, Map<String, Object> headers, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resulting Message to the specified destination, receive the reply and convert its body of the given target class.

Parameters
destinationName:String

the name of the target destination

request:Object

payload for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

requestPostProcessor:MessagePostProcessor

post process to apply to the request message

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
receiveback to summary
public Message<?> receive(String destinationName) throws MessagingException

Redeclares org.springframework.messaging.core.MessageReceivingOperations.receive.

Receive a message from the given destination.

Parameters
destinationName:String

the name of the target destination

Returns:Message<?>

the received message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
receiveAndConvertback to summary
public <T> T receiveAndConvert(String destinationName, Class<T> targetClass) throws MessagingException

Redeclares org.springframework.messaging.core.MessageReceivingOperations.receiveAndConvert.

Receive a message from the given destination and convert its payload to the specified target class.

Parameters
destinationName:String

the name of the target destination

targetClass:Class<T>

the target class to convert the payload to

Returns:T

the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
sendback to summary
public void send(String destinationName, Message<?> message) throws MessagingException

Redeclares org.springframework.messaging.core.MessageSendingOperations.send.

Send a message to the given destination.

Parameters
destinationName:String

the name of the target destination

message:Message<?>

the message to send

sendAndReceiveback to summary
public Message<?> sendAndReceive(String destinationName, Message<?> requestMessage) throws MessagingException

Redeclares org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

Send a request message and receive the reply from the given destination.

Parameters
destinationName:String

the name of the target destination

requestMessage:Message<?>

the message to send

Returns:Message<?>

the reply, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable