laravel / ideas

Issues board used for Laravel internals discussions.
939 stars 28 forks source link

Support to pick up messages off AQMP like rabbitMq #1787

Open mugisham opened 5 years ago

kish2011 commented 5 years ago

We are using the default queue in our app, we want to use rabbitMQ in our app. It would be a good idea if it supports by the core team, though third party lib present.

mugisham commented 5 years ago

We are using the default queue in our app, we want to use rabbitMQ in our app. It would be a good idea if it supports by the core team, though third party lib present.

I agree, currently working in a system with spring boot and Django and Rabbit is helping communicate with these loosely coupled systems.

michaeldyrynda commented 5 years ago

If I recall correctly, there used to be first-party support for Rabbit, but it was removed a long time ago in favour if Redis.

We vyuldashev/laravel-queue-rabbitmq in our app before migrating everything across to Redis. I think it makes more sense for Laravel to niche down and focus support, rather than trying to broadly support everything.

denizsokullu commented 5 years ago

We use rabbitmq in our ecosystem to exchange models and a bunch of other things. I started with https://github.com/vyuldashev/laravel-queue-rabbitmq but then ended up creating an artisan task that runs a subscription consumer loop that takes a message from rabbitmq and dispatches a job to a laravel redis queue. I can explain in more detail if you need help about it. The driver linked in this comment expects the messages in rabbitmq to be a certain format and a lot of the functionality is hardcoded. I found it too rigid to work with.

mugisham commented 5 years ago

But the messages sent in Laravel seem tightly bound to the application. the namespace of the job handler is sent to it which seems like an anti pattern. So if I wanted to send a message to a topic on Rabbit and have another system written in may be Flask or Spring. This is not possible and Flask has Celery. Cant we get a Celery?

denizsokullu commented 5 years ago

Yeah that's what I was trying to explain. The github repository I linked is tightly coupling the message with a laravel job instance. We also wanted freedom to modify the job payload. I will list what I did in steps: