PHP 5.6.0 released

AMQPQueue::nack

(PECL amqp >= Unknown)

AMQPQueue::nackMark a message as explicitly not acknowledged.

Descrição

public void AMQPQueue::nack ( string $delivery_tag [, string $flags = AMQP_NOPARAM ] )

Mark the message identified by delivery_tag as explicitly not acknowledged. This method can only be called on messages that have not yet been acknowledged, meaning that messages retrieved with by AMQPQueue::consume() and AMQPQueue::get() and using the AMQP_AUTOACK flag are not eligible.

When called, the broker will immediately put the message back onto the queue, instead of waiting until the connection is closed.

This method is only supported by the RabbitMQ broker. The behavior of calling this method while connected to any other broker is undefined.

Parâmetros

delivery_tag

The delivery tag by which to identify the message.

flags

A bitmask of flags.

Erros

Throws AMQPChannelException if the channel is not open.

Throws AMQPConnectionException if the connection to the broker was lost.

Valor Retornado

Retorna TRUE em caso de sucesso ou FALSE em caso de falha.

add a note add a note

User Contributed Notes 1 note

up
0
Olivier
2 years ago
You can use nack with consume, using those flags :
- On consume method : AMQP_NOPARAM
- On nack method : AMQP_REQUEUE
To Top