Interface StreamSender

    • Method Detail

      • send

        StreamTracker send​(Message<?> message)
                    throws ClientException
        Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit or there is a streaming send ongoing.
        Parameters:
        message - the Message to send.
        Returns:
        the Tracker for the message delivery
        Throws:
        ClientException - if an error occurs while initiating the send operation.
      • send

        StreamTracker send​(Message<?> message,
                           Map<String,​Object> deliveryAnnotations)
                    throws ClientException
        Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit or there is a streaming send ongoing. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.
        Parameters:
        message - the Message to send.
        deliveryAnnotations - the delivery annotations that should be included in the sent Message.
        Returns:
        the StreamTracker for the message delivery
        Throws:
        ClientException - if an error occurs while initiating the send operation.
      • trySend

        StreamTracker trySend​(Message<?> message)
                       throws ClientException
        Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt or a streaming send is ongoing.
        Parameters:
        message - the Message to send if credit is available.
        Returns:
        the StreamTracker for the message delivery or null if no credit for sending.
        Throws:
        ClientException - if an error occurs while initiating the send operation.
      • trySend

        StreamTracker trySend​(Message<?> message,
                              Map<String,​Object> deliveryAnnotations)
                       throws ClientException
        Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.
        Parameters:
        message - the Message to send if credit is available.
        deliveryAnnotations - the delivery annotations that should be included in the sent Message.
        Returns:
        the StreamTracker for the message delivery or null if no credit for sending.
        Throws:
        ClientException - if an error occurs while initiating the send operation.
      • beginMessage

        StreamSenderMessage beginMessage​(Map<String,​Object> deliveryAnnotations)
                                  throws ClientException
        Creates and returns a new StreamSenderMessage that can be used by the caller to perform streaming sends of large message payload data. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.
        Parameters:
        deliveryAnnotations - the delivery annotations that should be included in the sent StreamSenderMessage.
        Returns:
        a new StreamSenderMessage that can be used to stream message data to the remote.
        Throws:
        ClientException - if an error occurs while initiating a new streaming send message.