Connection
class 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
void
publish(string $body, array $headers = array())
Parameters
string | $body | |
array | $headers | |
Return Value
Exceptions
AMQPEnvelope|null
get()
Waits and gets a message from the configured queue.
Return Value
Exceptions
bool
ack(AMQPEnvelope $message)
Parameters
Return Value
bool
reject(AMQPEnvelope $message)
Parameters
Return Value
bool
nack(AMQPEnvelope $message, int $flags = AMQP_NOPARAM)
Parameters
AMQPEnvelope | $message | |
int | $flags | |
Return Value
void
setup()
Return Value
AMQPChannel
channel()
Return Value
AMQPQueue
queue()
Return Value
AMQPExchange
exchange()
Return Value
array
getConnectionCredentials()
Return Value