AmqpClient

AMQP Client entry point.

Use this interface to create an instance of @see \io\vertx\jphp\amqp\AmqpClient and connect to a broker and server.

package

Default

Methods

__construct

__construct() 

Closes the client.

close( $arg0) : void

The client must always be closed once not needed anymore.

Arguments

$arg0

callable

Connects to the AMQP broker or router. The location is specified in the @see \io\vertx\jphp\amqp\AmqpClientOptions as well as the potential credential required.

connect( $arg0) : $this

Arguments

$arg0

callable

Response

$this

Creates a new instance of @see \io\vertx\jphp\amqp\AmqpClient using an internal Vert.x instance (with default configuration) and the given AMQP client configuration. Note that the created Vert.x instance will be closed when the client is closed.

create( $arg0,  $arg1 = null) : \io\vertx\jphp\amqp\AmqpClient
static

param $options [array] the AMQP client options, may be {@code null} falling back to the default configuration create($options)

Creates a new instance of @see \io\vertx\jphp\amqp\AmqpClient with the given Vert.x instance and the given options.

param $vertx [Vertx] the vert.x instance, must not be {@code null} param $options [array] the AMQP options, may be @{code null} falling back to the default configuration create($vertx, $options)

Arguments

$arg0

array | Vertx

$arg1

array

Response

\io\vertx\jphp\amqp\AmqpClient

the created instances.

Creates a receiver used to consume messages from the given address. The receiver has no handler and won't start receiving messages until a handler is explicitly configured. This method avoids having to connect explicitly.

createReceiver( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : $this

You can retrieve the connection using @see \io\vertx\jphp\amqp\AmqpReceiver::connection.

param $address [string] The source address to attach the consumer to, must not be {@code null} param $completionHandler [callable] the handler called with the receiver. The receiver has been opened. createReceiver($address, $completionHandler)

Creates a receiver used to consume messages from the given address. This method avoids having to connect explicitly. You can retrieve the connection using @see \io\vertx\jphp\amqp\AmqpReceiver::connection.

param $address [string] The source address to attach the consumer to, must not be {@code null} param $messageHandler [callable] The message handler, must not be {@code null} param $completionHandler [callable] the handler called with the receiver that has been opened. Note that the {@code messageHandler} can be called before the {@code completionHandler} if messages are awaiting delivery. createReceiver($address, $messageHandler, $completionHandler)

Creates a receiver used to consumer messages from the given address. This method avoids having to connect explicitly. You can retrieve the connection using @see \io\vertx\jphp\amqp\AmqpReceiver::connection.

param $address [string] The source address to attach the consumer to. param $receiverOptions [array] The options for this receiver. param $messageHandler [callable] The message handler, must not be {@code null} param $completionHandler [callable] The handler called with the receiver, once opened. Note that the {@code messageHandler} can be called before the {@code completionHandler} if messages are awaiting delivery. createReceiver($address, $receiverOptions, $messageHandler, $completionHandler)

Arguments

$arg0

string

$arg1

callable | array

$arg2

callable

$arg3

callable

Response

$this

the client.

Creates a sender used to send messages to the given address. The address must be set.

createSender( $arg0,  $arg1,  $arg2 = null) : $this

param $address [string] The target address to attach to, must not be {@code null} param $completionHandler [callable] The handler called with the sender, once opened createSender($address, $completionHandler)

Creates a sender used to send messages to the given address. The address must be set.

param $address [string] The target address to attach to, must not be {@code null} param $options [array] The options for this sender. param $completionHandler [callable] The handler called with the sender, once opened createSender($address, $options, $completionHandler)

Arguments

$arg0

string

$arg1

callable | array

$arg2

callable

Response

$this

the client.