D
- the type of destinationpublic interface MessageReceivingOperations<D>
GenericMessagingTemplate
Modifier and Type | Method and Description |
---|---|
Message<?> |
receive()
Receive a message from a default destination.
|
Message<?> |
receive(D destination)
Receive a message from the given destination.
|
<T> T |
receiveAndConvert(java.lang.Class<T> targetClass)
Receive a message from a default destination and convert its payload to the
specified target class.
|
<T> T |
receiveAndConvert(D destination,
java.lang.Class<T> targetClass)
Receive a message from the given destination and convert its payload to the
specified target class.
|
@Nullable Message<?> receive() throws MessagingException
null
if the message could not
be received, for example due to a timeoutMessagingException
@Nullable Message<?> receive(D destination) throws MessagingException
destination
- the target destinationnull
if the message could not
be received, for example due to a timeoutMessagingException
@Nullable <T> T receiveAndConvert(java.lang.Class<T> targetClass) throws MessagingException
targetClass
- the target class to convert the payload tonull
if
the message could not be received, for example due to a timeoutMessagingException
@Nullable <T> T receiveAndConvert(D destination, java.lang.Class<T> targetClass) throws MessagingException
destination
- the target destinationtargetClass
- the target class to convert the payload tonull
if
the message could not be received, for example due to a timeoutMessagingException