AmqpSender

AMQP Sender interface used to send messages.

package

Default

Methods

__construct

__construct() 

address

address() : string

Response

string

the configured address.

Closes the sender.

close( $arg0) : void

Arguments

$arg0

callable

Gets the connection having created the sender. Cannot be <code>null</code>

connection() : \io\vertx\jphp\amqp\AmqpConnection

Response

\io\vertx\jphp\amqp\AmqpConnection

the connection having created the sender.

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.

drainHandler( $arg0) : $this

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

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Same as @see \io\vertx\jphp\core\streams\WriteStream::end but with an <code>handler</code> called when the operation completes

end( $arg0,  $arg1 = null) : void

param $handler [callable] end($handler)

Same as but with an handler called when the operation completes

param $data [AmqpMessage] param $handler [callable] end($data, $handler)

Arguments

$arg0

callable | AmqpMessage

$arg1

callable

exceptionHandler

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

Sends an AMQP message. The destination the configured sender address or the address configured in the message.

send( $arg0) : $this

Arguments

$arg0

AmqpMessage

Response

$this

the current sender

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.

sendWithAck( $arg0,  $arg1) : $this

Arguments

$arg0

AmqpMessage

$arg1

callable

Response

$this

the current sender

setWriteQueueMaxSize

setWriteQueueMaxSize( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Same as but with an <code>handler</code> called when the operation completes

write( $arg0,  $arg1) : void

Arguments

$arg0

AmqpMessage

$arg1

callable

This will return <code>true</code> if there are more bytes in the write queue than the value set using @see \io\vertx\jphp\amqp\AmqpSender::setWriteQueueMaxSize

writeQueueFull() : boolean

Response

boolean

true if write queue is full