What is the best way to pass events to another Laravel project? #291
-
This is a great library. We're using it in production. We've been asked to create a second Laravel project that will run on a different domain. It needs to generate reports based upon events recorded on the main platform. We'd then project data into the report tables so the users can pull out the exact data they need. Do any of you know how best to pass events from one project to another? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
sounds like a good case for rabbitmq. Other options are to have your event project make an api call to the new project over http when events are fired. A similar but more scalable, "eventually consistent" way is you expose an "events" api in your current project then begin polling that api from your new project at intervals based on how quickly it will need the data, you could use artisan scheduler for this. What you are describing is essentially microservices. Even still another, less advisable option is to poll the event stream directly over tcp using a shared database connection. |
Beta Was this translation helpful? Give feedback.
-
I have a similar case because I use event sourcing within each microservice but want to publish domain events to a global event store (which is not yet in place) so all services can listen to that global/domain event. I thought about using reactors to send specific events globally. Might this be a good idea or do you suggest something else? @inmanturbo |
Beta Was this translation helpful? Give feedback.
sounds like a good case for rabbitmq. Other options are to have your event project make an api call to the new project over http when events are fired. A similar but more scalable, "eventually consistent" way is you expose an "events" api in your current project then begin polling that api from your new project at intervals based on how quickly it will need the data, you could use artisan scheduler for this. What you are describing is essentially microservices. Even still another, less advisable option is to poll the event stream directly over tcp using a shared database connection.