org.springframework.messaging.core

Interface MessageReceivingOperations<D>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      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.
    • Method Detail

      • 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

        @Nullable
        <T> T receiveAndConvert(java.lang.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

        @Nullable
        <T> T receiveAndConvert(D destination,
                                          java.lang.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