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

请问一下,如何实现重试次数呢? #8

Closed
imlinfly opened this issue Mar 19, 2023 · 2 comments
Closed

请问一下,如何实现重试次数呢? #8

imlinfly opened this issue Mar 19, 2023 · 2 comments
Labels
question Further information is requested

Comments

@imlinfly
Copy link

No description provided.

@chaz6chez
Copy link
Member

不好意思,没有太明白需求点;
是要是实现重试次数的阈值设置吗?比如重试5次后抛弃消息?
如果是要实现重试后抛弃消息这种需求的话,我建议在消费者handler中自行实现,通过每次抛入队列后增加一个count计数即可实现

@imlinfly
Copy link
Author

不好意思,没有太明白需求点; 是要是实现重试次数的阈值设置吗?比如重试5次后抛弃消息? 如果是要实现重试后抛弃消息这种需求的话,我建议在消费者handler中自行实现,通过每次抛入队列后增加一个count计数即可实现

感谢回复,已经解决了

重试5次后抛弃消息,设置以下参数即可。

$message->setArguments(
    array_merge($message->getArguments(), [
        'x-queue-type' => 'quorum',
        'x-delivery-limit' => 5,
    ])
);

@chaz6chez chaz6chez pinned this issue Mar 28, 2023
@chaz6chez chaz6chez added the question Further information is requested label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants