Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reject a message and I'd like to contribute #47

Open
FROGGS opened this issue Jul 28, 2022 · 0 comments
Open

How to reject a message and I'd like to contribute #47

FROGGS opened this issue Jul 28, 2022 · 0 comments

Comments

@FROGGS
Copy link

FROGGS commented Jul 28, 2022

Hi, I struggled for the past couple of deas getting a dead-letter-exchange to be created, but now I'm unable to use it.

I can ack a message when I set no_ack to false. Note this is in an on-message callback of a channel:

$consumer->channel->ack($message)->deliver;

Though when I reject a message like this to forward it to the dead-letter-exchange:

$consumer->channel->reject(requeue => 0)->deliver;

I get:

[2022-07-28 07:32:08.44986] [134610] [info] RabbitMQ[#1] Consumer ready
[2022-07-28 07:32:08.45701] [134610] [debug] RabbitMQ: received message
-> "\1\0\1\0\0\0\r\0<\0Z\0\0\0\0\0\0\0\0\0\316"
<- "\1\0\1\0\0\0007\0\24\0(\1\226,PRECONDITION_FAILED - unknown delivery tag 0\0<\0Z\316"
-> "\1\0\1\0\0\0\4\0\24\0)\316"
[2022-07-28 07:32:08.51695] [134610] [warn] RabbitMQ[#1] Channel closed

So, after digging more around I found out that I need to set multiple => 0, so this works:

$consumer->channel->reject(delivery_tag => 1, multiple => 0, requeue => 0)->deliver;

To spare others from going through this rabbit hole (pun intended), I'd like to contribute to the documentation.
Can you please give me a commit bit here on gitlab and perhaps co-maint on pause? My PAUSE-ID is FROGGS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant