W3cubDocs

/Symfony 4.1

Connection

class Connection

An AMQP connection.

Methods

__construct(array $connectionCredentials, array $exchangeConfiguration, array $queueConfiguration, bool $debug = false, AmqpFactory $amqpFactory = null)
static Connection fromDsn(string $dsn, array $options = array(), bool $debug = false, AmqpFactory $amqpFactory = null)
void publish(string $body, array $headers = array())
AMQPEnvelope|null get()

Waits and gets a message from the configured queue.

bool ack(AMQPEnvelope $message)
bool reject(AMQPEnvelope $message)
bool nack(AMQPEnvelope $message, int $flags = AMQP_NOPARAM)
void setup()
AMQPChannel channel()
AMQPQueue queue()
AMQPExchange exchange()
array getConnectionCredentials()

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

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Messenger/Transport/AmqpExt/Connection.html