org.springframework.messaging.core

## Interface DestinationResolvingMessageReceivingOperations<D>

- All Superinterfaces:
    MessageReceivingOperations<D>
  All Known Implementing Classes:
    AbstractDestinationResolvingMessagingTemplate, GenericMessagingTemplate

      public interface DestinationResolvingMessageReceivingOperations<D>
      extends MessageReceivingOperations<D>

  Extends `MessageReceivingOperations` and adds operations for receiving messages from a destination specified as a (resolvable) String name.
  Since:
    4.0
  Author:
    Mark Fisher, Rossen Stoyanchev
  See Also:
    `DestinationResolver`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Message<?>` | `receive(String destinationName)` Resolve the given destination name and receive a message from it.
    `<T> T` | `receiveAndConvert(String destinationName, Class<T> targetClass)` Resolve the given destination name, receive a message from it, convert the payload to the specified target type.

    - ### Methods inherited from interface org.springframework.messaging.core.MessageReceivingOperations

      `receive, receive, receiveAndConvert, receiveAndConvert`

- - ### Method Detail

    - #### receive

          Message<?> receive(String destinationName)
                      throws MessagingException

      Resolve the given destination name and receive a message from it.
      Parameters:
        `destinationName` - the destination name to resolve
      Throws:
        `MessagingException`

    - #### receiveAndConvert

          <T> T receiveAndConvert(String destinationName,
                                  Class<T> targetClass)
                           throws MessagingException

      Resolve the given destination name, receive a message from it, convert the payload to the specified target type.
      Parameters:
        `destinationName` - the destination name to resolve
        `targetClass` - the target class for the converted payload
      Throws:
        `MessagingException`