接口 JmsMessageOperations
- 所有超级接口:
MessageReceivingOperations<Destination>
,MessageRequestReplyOperations<Destination>
,MessageSendingOperations<Destination>
- 所有已知实现类:
JmsMessagingTemplate
public interface JmsMessageOperations extends MessageSendingOperations<Destination>, MessageReceivingOperations<Destination>, MessageRequestReplyOperations<Destination>
A specialization ofMessageSendingOperations
,MessageReceivingOperations
andMessageRequestReplyOperations
for JMS related operations that allow to specify a destination name rather than the actualDestination
- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll
- 另请参阅:
JmsTemplate
,MessageSendingOperations
,MessageReceivingOperations
,MessageRequestReplyOperations
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
convertAndSend(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.void
convertAndSend(String destinationName, Object payload, Map<String,Object> headers)
Convert 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.void
convertAndSend(String destinationName, Object payload, Map<String,Object> headers, 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.void
convertAndSend(String destinationName, Object payload, 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> T
convertSendAndReceive(String destinationName, Object request, Class<T> targetClass)
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
to the given destination, receive the reply and convert its body of the specified target class.<T> T
convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor)
Convert the given request Object to serialized form, possibly using aMessageConverter
, apply the given post processor and send the resultingMessage
to the given destination, receive the reply and convert its body of the given target class.<T> T
convertSendAndReceive(String destinationName, Object request, Map<String,Object> headers, Class<T> targetClass)
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.<T> T
convertSendAndReceive(String destinationName, Object request, Map<String,Object> headers, Class<T> targetClass, 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 resultingMessage
to the specified destination, receive the reply and convert its body of the given target class.Message<?>
receive(String destinationName)
Receive a message from the given destination.<T> T
receiveAndConvert(String destinationName, Class<T> targetClass)
Receive a message from the given destination and convert its payload to the specified target class.void
send(String destinationName, Message<?> message)
Send a message to the given destination.Message<?>
sendAndReceive(String destinationName, Message<?> requestMessage)
Send a request message and receive the reply from the given destination.从接口继承的方法 org.springframework.messaging.core.MessageReceivingOperations
receive, receive, receiveAndConvert, receiveAndConvert
从接口继承的方法 org.springframework.messaging.core.MessageRequestReplyOperations
convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive, sendAndReceive
从接口继承的方法 org.springframework.messaging.core.MessageSendingOperations
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, send
方法详细资料
send
void send(String destinationName, Message<?> message) throws MessagingException
Send a message to the given destination.- 参数:
destinationName
- the name of the target destinationmessage
- the message to send- 抛出:
MessagingException
convertAndSend
void convertAndSend(String destinationName, Object payload) throws MessagingException
Convert the given Object to serialized form, possibly using aMessageConverter
, wrap it as a message and send it to the given destination.- 参数:
destinationName
- the name of the target destinationpayload
- the Object to use as payload- 抛出:
MessagingException
convertAndSend
void convertAndSend(String destinationName, Object payload, Map<String,Object> headers) throws MessagingException
Convert 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.- 参数:
destinationName
- the name of the target destinationpayload
- the Object to use as payloadheaders
- headers for the message to send- 抛出:
MessagingException
convertAndSend
void convertAndSend(String destinationName, Object payload, 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.- 参数:
destinationName
- the name of the target destinationpayload
- the Object to use as payloadpostProcessor
- the post processor to apply to the message- 抛出:
MessagingException
convertAndSend
void convertAndSend(String destinationName, Object payload, Map<String,Object> headers, MessagePostProcessor postProcessor) throws MessagingException
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.- 参数:
destinationName
- the name of the target destinationpayload
- the Object to use as payloadheaders
- headers for the message to sendpostProcessor
- the post processor to apply to the message- 抛出:
MessagingException
receive
Message<?> receive(String destinationName) throws MessagingException
Receive a message from the given destination.- 参数:
destinationName
- the name of the target destination- 返回:
- the received message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
receiveAndConvert
<T> 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.- 参数:
destinationName
- the name of the target destinationtargetClass
- the target class to convert the payload to- 返回:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
sendAndReceive
Message<?> sendAndReceive(String destinationName, Message<?> requestMessage) throws MessagingException
Send a request message and receive the reply from the given destination.- 参数:
destinationName
- the name of the target destinationrequestMessage
- the message to send- 返回:
- the reply, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
<T> 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 aMessage
to the given destination, receive the reply and convert its body of the specified target class.- 参数:
destinationName
- the name of the target destinationrequest
- payload for the request message to sendtargetClass
- the target type to convert the payload of the reply to- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
<T> T convertSendAndReceive(String destinationName, Object request, Map<String,Object> headers, Class<T> targetClass) throws MessagingException
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.- 参数:
destinationName
- the name of the target destinationrequest
- payload for the request message to sendheaders
- headers for the request message to sendtargetClass
- the target type to convert the payload of the reply to- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
<T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException
Convert the given request Object to serialized form, possibly using aMessageConverter
, apply the given post processor and send the resultingMessage
to the given destination, receive the reply and convert its body of the given target class.- 参数:
destinationName
- the name of the target destinationrequest
- payload for the request message to sendtargetClass
- the target type to convert the payload of the reply torequestPostProcessor
- post process to apply to the request message- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
<T> T convertSendAndReceive(String destinationName, Object request, Map<String,Object> headers, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException
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 resultingMessage
to the specified destination, receive the reply and convert its body of the given target class.- 参数:
destinationName
- the name of the target destinationrequest
- payload for the request message to sendtargetClass
- the target type to convert the payload of the reply torequestPostProcessor
- post process to apply to the request message- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException