10 months ago

Consuming jobs from laravel queues with Node

Posted 10 months ago by sustained

Does anyone have any experience with this or any ideas/input? Or perhaps an alternative method of communicating with my node program from Laravel?

My current setup is thus:

  1. I have one server running a long-running Node process (let's call it node) as well as a Laravel app that acts as a purely private API (let's call it papi). The server as a whole, let's call node/papi.
  2. I also have a second server which is also a Laravel app but this one is publicly accessible (via the web), let's call this server web.

Note that web is also able to communicate with papi.

So, the web server is going to be powering a relatively complex web application and so I will be using jobs/queues for various things, most likely. And most of these I'll want to consume from PHP/Laravel code.

But now and again, I'll need a job triggered from web to be ultimately processed by node.

I'm thinking that I can just have a second job queue setup on papi which is solely for node-specific jobs.

Then I can presumably just not run any queue worker at all on the node/papi server and instead consume those jobs from Node/JS.

But this all feels a little clunky. Any input appreciated.

Please sign in or create an account to participate in this conversation.