Methods

getChannel()

getChannel() : \AMQPChannel

Returns

\AMQPChannel

qos()

qos(integer  $count, integer  $size) : static

Parameters

integer $count
integer $size

Returns

static

declareExchange()

declareExchange(string  $name, string  $type = AMQP_EX_TYPE_DIRECT, integer  $flags = AMQP_DURABLE) : \AMQPExchange

Parameters

string $name
string $type
integer $flags

support the following flags: AMQP_DURABLE, AMQP_PASSIVE.

Returns

\AMQPExchange

getExchanges()

getExchanges(boolean  $name_only = true) : array<mixed,\AMQPExchange>|array<mixed,string>

Parameters

boolean $name_only

Returns

array<mixed,\AMQPExchange>|array<mixed,string>

deleteExchange()

deleteExchange(string  $name, integer  $flags = AMQP_NOPARAM) : static

Parameters

string $name
integer $flags

Optionally AMQP_IFUNUSED can be specified to indicate the exchange should not be deleted until no clients are connected to it.

Returns

static

declareQueue()

declareQueue(string  $name, integer  $flags = AMQP_DURABLE) : \AMQPQueue

Parameters

string $name
integer $flags

Returns

\AMQPQueue

getQueues()

getQueues(boolean  $name_only = true) : array<mixed,\AMQPQueue>|array<mixed,string>

Parameters

boolean $name_only

Returns

array<mixed,\AMQPQueue>|array<mixed,string>

bindQueue()

bindQueue(string  $queue, string  $exchange, string  $binding_key = '') : static

Parameters

string $queue
string $exchange
string $binding_key

Returns

static

purgeQueue()

purgeQueue(string  $name) : static

Purge the contents of a queue

Parameters

string $name

Returns

static

deleteQueue()

deleteQueue(string  $name) : static

Parameters

string $name

Returns

static

publishMessage()

publishMessage(string  $message, string  $exchange, string  $routing_key = '', integer  $flags = AMQP_NOPARAM, array  $attributes = array()) : static

Parameters

string $message
string $exchange
string $routing_key
integer $flags

One or more of AMQP_MANDATORY and AMQP_IMMEDIATE

array $attributes

Returns

static

publishJsonMessage()

publishJsonMessage(array|\JsonSerializable  $message, string  $exchange, string  $routing_key = '', integer  $flags = AMQP_NOPARAM, array  $attributes = array()) : static

Parameters

array|\JsonSerializable $message
string $exchange
string $routing_key
integer $flags

One or more of AMQP_MANDATORY and AMQP_IMMEDIATE

array $attributes

Returns

static

getMessage()

getMessage(string  $queue, boolean  $auto_ack = false) : false|\ManaPHP\Messaging\Amqp\Message

Parameters

string $queue
boolean $auto_ack

Returns

false|\ManaPHP\Messaging\Amqp\Message

getJsonMessage()

getJsonMessage(string  $queue, boolean  $auto_ack = false) : false|array

Parameters

string $queue
boolean $auto_ack

Returns

false|array

ackMessage()

ackMessage(\ManaPHP\Messaging\Amqp\Message|array  $message, boolean  $multiple = false) : static

Parameters

\ManaPHP\Messaging\Amqp\Message|array $message
boolean $multiple

Returns

static

nackMessage()

nackMessage(\ManaPHP\Messaging\Amqp\Message|array  $message, boolean  $multiple = false) : static

Parameters

\ManaPHP\Messaging\Amqp\Message|array $message
boolean $multiple

Returns

static

consumeMessages()

consumeMessages(string  $queue, callable  $callback, integer  $flags = AMQP_NOPARAM) : void

Parameters

string $queue
callable $callback
integer $flags