Class AmqpSender

    • Constructor Detail

      • AmqpSender

        public AmqpSender​(AmqpSender delegate)
      • AmqpSender

        public AmqpSender​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • write

        public void write​(AmqpMessage data)
        Same as but with an handler called when the operation completes
        Specified by:
        write in interface WriteStream<AmqpMessage>
        Parameters:
        data -
      • rxWrite

        public io.reactivex.Completable rxWrite​(AmqpMessage data)
        Same as but with an handler called when the operation completes
        Specified by:
        rxWrite in interface WriteStream<AmqpMessage>
        Parameters:
        data -
        Returns:
      • end

        public void end​(AmqpMessage data)
        Same as but with an handler called when the operation completes
        Specified by:
        end in interface WriteStream<AmqpMessage>
        Parameters:
        data -
      • rxEnd

        public io.reactivex.Completable rxEnd​(AmqpMessage data)
        Same as but with an handler called when the operation completes
        Specified by:
        rxEnd in interface WriteStream<AmqpMessage>
        Parameters:
        data -
        Returns:
      • drainHandler

        public WriteStream<AmqpMessage> drainHandler​(Handler<Void> handler)
        Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue is ready to accept buffers again. See for an example of this being used.

        The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced to maxSize / 2.

        Specified by:
        drainHandler in interface WriteStream<AmqpMessage>
        Parameters:
        handler - the handler
        Returns:
        a reference to this, so the API can be used fluently
      • setWriteQueueMaxSize

        public AmqpSender setWriteQueueMaxSize​(int maxSize)
        Description copied from interface: WriteStream
        Set the maximum size of the write queue to maxSize. You will still be able to write to the stream even if there is more than maxSize items in the write queue. This is used as an indicator by classes such as Pipe to provide flow control.

        The value is defined by the implementation of the stream, e.g in bytes for a NetSocket, etc...

        Specified by:
        setWriteQueueMaxSize in interface WriteStream<AmqpMessage>
        Parameters:
        maxSize - the max size of the write stream
        Returns:
        a reference to this, so the API can be used fluently
      • send

        public AmqpSender send​(AmqpMessage message)
        Sends an AMQP message. The destination the configured sender address or the address configured in the message.
        Parameters:
        message - the message, must not be null
        Returns:
        the current sender
      • sendWithAck

        public AmqpSender sendWithAck​(AmqpMessage message,
                                      Handler<AsyncResult<Void>> acknowledgementHandler)
        Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an marked as failed if the message has been rejected or re-routed. If the message has been accepted, the handler is called with a success.
        Parameters:
        message - the message, must not be null
        acknowledgementHandler - the acknowledgement handler, must not be null
        Returns:
        the current sender
      • sendWithAck

        public AmqpSender sendWithAck​(AmqpMessage message)
        Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an marked as failed if the message has been rejected or re-routed. If the message has been accepted, the handler is called with a success.
        Parameters:
        message - the message, must not be null
        Returns:
        the current sender
      • rxSendWithAck

        public io.reactivex.Completable rxSendWithAck​(AmqpMessage message)
        Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an marked as failed if the message has been rejected or re-routed. If the message has been accepted, the handler is called with a success.
        Parameters:
        message - the message, must not be null
        Returns:
        the current sender
      • close

        public void close​(Handler<AsyncResult<Void>> handler)
        Closes the sender.
        Parameters:
        handler - called when the sender has been closed, must not be null
      • close

        public void close()
        Closes the sender.
      • rxClose

        public io.reactivex.Completable rxClose()
        Closes the sender.
        Returns:
      • address

        public String address()
        Returns:
        the configured address.
      • connection

        public AmqpConnection connection()
        Gets the connection having created the sender. Cannot be null
        Returns:
        the connection having created the sender.
      • remainingCredits

        public long remainingCredits()
        Returns:
        the remaining credit, 0 is none.
      • unwrap

        public io.vertx.proton.ProtonSender unwrap()
        Returns:
        the underlying ProtonSender.