Skip to content

[Question] [php-amqp RabbitMQ] Is it possible to have message processors with automatic acknowledgement? #1115

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

Closed
renatogcarvalho opened this issue Nov 13, 2020 · 1 comment
Labels

Comments

@renatogcarvalho
Copy link

renatogcarvalho commented Nov 13, 2020

Hello,

I have a Symfony application configured using php-amqp and RabbitMQ with:

  1. A general queue dedicated for messages from an API of which I have hundreds of message processors running on dedicated pool of queue worker servers, using a configuration similar to your documentation: https://php-enqueue.github.io/consumption/message_processor/

  2. A "reply queue" that is created during each API request that is used to forward the results from the messages consumed by the processors, which during onKernelTerminate is deleted.

My main goal is increase the throughput of my consumers, since I don't really need to worry about persistence on this workflow. The queue configured on item 1 is expected to receive millions of messages (10m+ or more) every day.

For the "reply queues" configured for item 2 I was able to set a NOACK flag in the consumer as follows:

$replyConsumer = $this->producer
->getContext()
->createConsumer($replyQueue)
;

$replyConsumer->setFlags(AmqpConsumer::FLAG_NOACK);

I wonder if there is a way that I can also set this flag somehow to the message processors? Or do you think I should maybe consider taking a different approach? What I most like about it (thanks to you!!!) is the convenience of running the CLI commands and be able to tie signals and use the extensions to watch for max execution time and memory usage.

Also, would you have any recommendation for this setup regarding the qos_prefetch_count connection setting? I currently have it set to 1 as I have hundreds of processors to go through these messages, but I wonder if increasing this setting would help it somehow.

Much appreciated your feedback.

Thanks.

-R.

@renatogcarvalho renatogcarvalho changed the title [Question] [php-amqp RabbitMQ] Is it possible to have message processors with automatic acknowlegment? [Question] [php-amqp RabbitMQ] Is it possible to have message processors with automatic acknowledgement? Nov 14, 2020
@stale
Copy link

stale bot commented Dec 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 18, 2020
@stale stale bot closed this as completed Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant