class Connection

An AMQP connection.

Methods

__construct(array $connectionCredentials, array $exchangeConfiguration, array $queueConfiguration, bool $debug = false, AmqpFactory $amqpFactory = null)

No description

static Connection
fromDsn(string $dsn, array $options = array(), bool $debug = false, AmqpFactory $amqpFactory = null)

No description

void
publish(string $body, array $headers = array())

No description

AMQPEnvelope|null
get()

Waits and gets a message from the configured queue.

bool
ack(AMQPEnvelope $message)

No description

bool
reject(AMQPEnvelope $message)

No description

bool
nack(AMQPEnvelope $message, int $flags = AMQP_NOPARAM)

No description

void
setup()

No description

AMQPChannel
channel()

No description

AMQPQueue
queue()

No description

AMQPExchange
exchange()

No description

array
getConnectionCredentials()

No description

Details

__construct(array $connectionCredentials, array $exchangeConfiguration, array $queueConfiguration, bool $debug = false, AmqpFactory $amqpFactory = null)

Parameters

array $connectionCredentials
array $exchangeConfiguration
array $queueConfiguration
bool $debug
AmqpFactory $amqpFactory

static Connection fromDsn(string $dsn, array $options = array(), bool $debug = false, AmqpFactory $amqpFactory = null)

Parameters

string $dsn
array $options
bool $debug
AmqpFactory $amqpFactory

Return Value

Connection

void publish(string $body, array $headers = array())

Parameters

string $body
array $headers

Return Value

void

Exceptions

AMQPException

AMQPEnvelope|null get()

Waits and gets a message from the configured queue.

Return Value

AMQPEnvelope|null

Exceptions

AMQPException

bool ack(AMQPEnvelope $message)

Parameters

AMQPEnvelope $message

Return Value

bool

bool reject(AMQPEnvelope $message)

Parameters

AMQPEnvelope $message

Return Value

bool

bool nack(AMQPEnvelope $message, int $flags = AMQP_NOPARAM)

Parameters

AMQPEnvelope $message
int $flags

Return Value

bool

void setup()

Return Value

void

AMQPChannel channel()

Return Value

AMQPChannel

AMQPQueue queue()

Return Value

AMQPQueue

AMQPExchange exchange()

Return Value

AMQPExchange

array getConnectionCredentials()

Return Value

array