Top Description Methods
org.springframework.messaging.core

public Interface MessageReceivingOperations<D>

Known Direct Subinterfaces
org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations
Known Direct Implementers
org.springframework.messaging.core.AbstractMessageReceivingTemplate
Type Parameters
<D>
the type of destination
Imports
org.springframework.lang.Nullable, org.springframework.messaging.Message, .MessagingException

Operations for receiving messages from a destination.
Authors
Mark Fisher, Rossen Stoyanchev
Since
4.0
See Also
GenericMessagingTemplate

Method Summary

Modifier and TypeMethod and Description
public Message<?>

Returns:

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

Receive a message from a default destination.

public Message<?>

Returns:

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

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
(Class<T>
the target class to convert the payload to
targetClass
)

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

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
(D
the target destination
destination
,
Class<T>
the target class to convert the payload to
targetClass
)

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

Method Detail

receiveback to summary
public Message<?> receive() throws MessagingException

Receive a message from a default destination.

Returns:Message<?>

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

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

Receive a message from the given destination.

Parameters
destination:D

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(Class<T> targetClass) throws MessagingException

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

Parameters
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
receiveAndConvertback to summary
public <T> T receiveAndConvert(D destination, Class<T> targetClass) throws MessagingException

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

Parameters
destination:D

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