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 = [], bool $debug = false, AmqpFactory $amqpFactory = null)

No description

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

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

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

Parameters

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

at line 51
static Connection fromDsn(string $dsn, array $options = [], bool $debug = false, AmqpFactory $amqpFactory = null)

Parameters

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

Return Value

Connection

at line 95
void publish(string $body, array $headers = [])

Parameters

string $body
array $headers

Return Value

void

Exceptions

AMQPException

at line 109
AMQPEnvelope|null get()

Waits and gets a message from the configured queue.

Return Value

AMQPEnvelope|null

Exceptions

AMQPException

at line 133
bool ack(AMQPEnvelope $message)

Parameters

AMQPEnvelope $message

Return Value

bool

at line 138
bool reject(AMQPEnvelope $message)

Parameters

AMQPEnvelope $message

Return Value

bool

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

Parameters

AMQPEnvelope $message
int $flags

Return Value

bool

at line 148
void setup()

Return Value

void

at line 160
AMQPChannel channel()

Return Value

AMQPChannel

at line 176
AMQPQueue queue()

Return Value

AMQPQueue

at line 191
AMQPExchange exchange()

Return Value

AMQPExchange

at line 207
array getConnectionCredentials()

Return Value

array