org.springframework.jms.core

Interface JmsMessageOperations

    • Method Detail

      • send

        void send(java.lang.String destinationName,
                  Message<?> message)
           throws MessagingException
        Send a message to the given destination.
        Parameters:
        destinationName - the name of the target destination
        message - the message to send
        Throws:
        MessagingException
      • convertAndSend

        void convertAndSend(java.lang.String destinationName,
                            java.lang.Object payload)
                     throws MessagingException
        Convert the given Object to serialized form, possibly using a MessageConverter, wrap it as a message and send it to the given destination.
        Parameters:
        destinationName - the name of the target destination
        payload - the Object to use as payload
        Throws:
        MessagingException
      • convertAndSend

        void convertAndSend(java.lang.String destinationName,
                            java.lang.Object payload,
                            java.util.Map<java.lang.String,java.lang.Object> headers)
                     throws MessagingException
        Convert the given Object to serialized form, possibly using a MessageConverter, wrap it as a message with the given headers and send it to the given destination.
        Parameters:
        destinationName - the name of the target destination
        payload - the Object to use as payload
        headers - headers for the message to send
        Throws:
        MessagingException
      • convertAndSend

        void convertAndSend(java.lang.String destinationName,
                            java.lang.Object payload,
                            MessagePostProcessor postProcessor)
                     throws MessagingException
        Convert the given Object to serialized form, possibly using a MessageConverter, wrap it as a message, apply the given post processor, and send the resulting message to the given destination.
        Parameters:
        destinationName - the name of the target destination
        payload - the Object to use as payload
        postProcessor - the post processor to apply to the message
        Throws:
        MessagingException
      • convertAndSend

        void convertAndSend(java.lang.String destinationName,
                            java.lang.Object payload,
                            @Nullable
                            java.util.Map<java.lang.String,java.lang.Object> headers,
                            @Nullable
                            MessagePostProcessor postProcessor)
                     throws MessagingException
        Convert the given Object to serialized form, possibly using a MessageConverter, wrap it as a message with the given headers, apply the given post processor, and send the resulting message to the given destination.
        Parameters:
        destinationName - the name of the target destination
        payload - the Object to use as payload
        headers - headers for the message to send
        postProcessor - the post processor to apply to the message
        Throws:
        MessagingException
      • receive

        @Nullable
        Message<?> receive(java.lang.String destinationName)
                              throws MessagingException
        Receive a message from the given destination.
        Parameters:
        destinationName - the name of 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.String destinationName,
                                          java.lang.Class<T> targetClass)
                                   throws MessagingException
        Receive a message from the given destination and convert its payload to the specified target class.
        Parameters:
        destinationName - the name of 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
      • sendAndReceive

        @Nullable
        Message<?> sendAndReceive(java.lang.String destinationName,
                                            Message<?> requestMessage)
                                     throws MessagingException
        Send a request message and receive the reply from the given destination.
        Parameters:
        destinationName - the name of the target destination
        requestMessage - the message to send
        Returns:
        the reply, possibly null if the message could not be received, for example due to a timeout
        Throws:
        MessagingException
      • convertSendAndReceive

        @Nullable
        <T> T convertSendAndReceive(java.lang.String destinationName,
                                              java.lang.Object request,
                                              java.lang.Class<T> targetClass)
                                       throws MessagingException
        Convert the given request Object to serialized form, possibly using a MessageConverter, send it as a Message to the given destination, receive the reply and convert its body of the specified target class.
        Parameters:
        destinationName - the name of the target destination
        request - payload for the request message to send
        targetClass - the target type to convert the payload of the reply to
        Returns:
        the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
        Throws:
        MessagingException
      • convertSendAndReceive

        @Nullable
        <T> T convertSendAndReceive(java.lang.String destinationName,
                                              java.lang.Object request,
                                              @Nullable
                                              java.util.Map<java.lang.String,java.lang.Object> headers,
                                              java.lang.Class<T> targetClass)
                                       throws MessagingException
        Convert the given request Object to serialized form, possibly using a MessageConverter, send it as a Message with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.
        Parameters:
        destinationName - the name of the target destination
        request - payload for the request message to send
        headers - headers for the request message to send
        targetClass - the target type to convert the payload of the reply to
        Returns:
        the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
        Throws:
        MessagingException
      • convertSendAndReceive

        @Nullable
        <T> T convertSendAndReceive(java.lang.String destinationName,
                                              java.lang.Object request,
                                              java.lang.Class<T> targetClass,
                                              MessagePostProcessor requestPostProcessor)
                                       throws MessagingException
        Convert the given request Object to serialized form, possibly using a MessageConverter, apply the given post processor and send the resulting Message to the given destination, receive the reply and convert its body of the given target class.
        Parameters:
        destinationName - the name of the target destination
        request - payload for the request message to send
        targetClass - the target type to convert the payload of the reply to
        requestPostProcessor - post process to apply to the request message
        Returns:
        the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
        Throws:
        MessagingException
      • convertSendAndReceive

        @Nullable
        <T> T convertSendAndReceive(java.lang.String destinationName,
                                              java.lang.Object request,
                                              java.util.Map<java.lang.String,java.lang.Object> headers,
                                              java.lang.Class<T> targetClass,
                                              MessagePostProcessor requestPostProcessor)
                                       throws MessagingException
        Convert the given request Object to serialized form, possibly using a MessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resulting Message to the specified destination, receive the reply and convert its body of the given target class.
        Parameters:
        destinationName - the name of the target destination
        request - payload for the request message to send
        targetClass - the target type to convert the payload of the reply to
        requestPostProcessor - post process to apply to the request message
        Returns:
        the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
        Throws:
        MessagingException