Interface MessageReceivingOperations<d>

Type Parameters:
d - the type of destination
All Known Subinterfaces:
destinationResolvingMessageReceivingOperations<d>, JmsMessageOperations
All Known Implementing Classes:
AbstractdestinationResolvingMessagingTemplate, AbstractMessageReceivingTemplate, AbstractMessagingTemplate, GenericMessagingTemplate, JmsMessagingTemplate

public interface MessageReceivingOperations<d>
Operations for receiving messages from a destination.
Since:
4.0
Author:
Mark Fisher, Rossen Stoyanchev
See Also:
  • Method Summary

    Modifier and Type
    Method
    description
    Receive a message from a default destination.
    receive(d destination)
    Receive a message from the given destination.
    <T> @Nullable T
    receiveAndConvert(d destination, Class<T> targetClass)
    Receive a message from the given destination and convert its payload to the specified target class.
    <T> @Nullable T
    receiveAndConvert(Class<T> targetClass)
    Receive a message from a default destination and convert its payload to the specified target class.
  • Method details

    • receive

      @Nullable Message<?> receive() throws MessagingException
      Receive a message from a default destination.
      Returns:
      the received message, possibly null if the message could not be received, for example due to a timeout
      Throws:
      MessagingException
    • receive

      @Nullable Message<?> receive(d destination) throws MessagingException
      Receive a message from the given destination.
      Parameters:
      destination - the target destination
      Returns:
      the received message, possibly null if the message could not be received, for example due to a timeout
      Throws:
      MessagingException
    • receiveAndConvert

      <T> @Nullable 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 - the target class to convert the payload to
      Returns:
      the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout
      Throws:
      MessagingException
    • receiveAndConvert

      <T> @Nullable 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 - the target destination
      targetClass - the target class to convert the payload to
      Returns:
      the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout
      Throws:
      MessagingException