AmqpConnection

Once connected to the broker or router, you get a connection. This connection is automatically opened.

package

Default

Methods

__construct

__construct() 

Closes the AMQP connection, i.e. allows the Close frame to be emitted.

close( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the connection

Creates an anonymous sender.

createAnonymousSender( $arg0) : $this

Unlike "regular" sender, this sender is not associated to a specific address, and each message sent must provide an address. This method can be used in request-reply scenarios where you create a sender to send the reply, but you don't know the address, as the reply address is passed into the message you are going to receive.

Arguments

$arg0

callable

Response

$this

the connection.

Creates a dynamic receiver. The address is provided by the broker and is available in the <code>completionHandler</code>, using the @see \io\vertx\jphp\amqp\AmqpReceiver::address method. this method is useful for request-reply to generate a unique reply address.

createDynamicReceiver( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the connection.

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.

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

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.

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.

param $address [string] The source address to attach the consumer to. param $receiverOptions [array] The options for this receiver. 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, $completionHandler)

Creates a receiver used to consumer messages from the given address.

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 connection.

Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, check

createSender( $arg0,  $arg1,  $arg2 = null) : $this
see \io\vertx\jphp\amqp\AmqpConnection::createAnonymousSender.

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. For anonymous sender, check

\io\vertx\jphp\amqp\AmqpConnection::createAnonymousSender.

param $address [string] The target address to attach to, allowed to be {@code null} if the {@code options} configures the sender to be attached to a dynamic address (provided by the broker). param $options [array] The AMQP sender options 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 connection.

Registers a handler called on disconnection.

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this