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

Better interface to integrate RabbitMQ #19

Open
dfeyer opened this issue Oct 20, 2017 · 3 comments
Open

Better interface to integrate RabbitMQ #19

dfeyer opened this issue Oct 20, 2017 · 3 comments

Comments

@dfeyer
Copy link

dfeyer commented Oct 20, 2017

I have a project that need to use RabbitMQ, currently the JobQueue package, connect to the queue server for each message, it's not really efficient.

RabbitMQ offers API to use closure to consume message, with connection/deconnection between each message, its more efficiant and allow more monitoring of the consumer, because the connection lives a long time.

Any idea how we can extend the JobQueue package to support this kind of case ?

See this consumer example https://github.com/php-amqplib/php-amqplib/blob/master/demo/amqp_consumer.php#L67

@bwaidelich
Copy link
Contributor

@dfeyer when you write "for each message" you are talking about consuming messages, right?
So basically this part in your implementation: https://github.com/ttreeagency/Flowpack.JoqQueue.RabbitMQ/blob/master/Classes/RabbitQueue.php#L92-L125

The main entry point for these methods is JobManager::waitAndExecute() which is called in an endless loop by the work CLI command.
So we would need to turn that around to allow the queue to invoke a callback for new messages, right?

@dfeyer
Copy link
Author

dfeyer commented Oct 20, 2017

Yes, the AMQP prototocol is heavy and if we can avoid the to repeat the connection process for every message, it could be really nice

@dfeyer
Copy link
Author

dfeyer commented Oct 20, 2017

I push a new version of my RabbitMQ integration, a bit more efficiant by using AMQP wait function and proper QoS configuration.

@kdambekalns kdambekalns changed the title Better interface to integrate RabbidMQ Better interface to integrate RabbitMQ Mar 20, 2018
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

2 participants