Skip to content

Attach example plzz #610

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

Open
imphunq opened this issue Dec 7, 2024 · 3 comments
Open

Attach example plzz #610

imphunq opened this issue Dec 7, 2024 · 3 comments

Comments

@imphunq
Copy link

imphunq commented Dec 7, 2024

I have two laravel apps and i want to message between them

@ALTELMA
Copy link

ALTELMA commented Dec 23, 2024

In case from my experience let me try to give you for some idea

  1. App A just add only ExampleJobA::dispatch()
  2. From the previous code the data will be sent to RabbitMQ
  3. App B run php artisan queue:work rabbitmq, It was running as consumer and waiting for incoming message
  4. In case of you have multiple queue you need to run php artisan queue:work --queue=job1,job2

Sorry for a quick reply it may not clear at all. Let me know if you have any questions.

@imphunq
Copy link
Author

imphunq commented Dec 29, 2024

@ALTELMA Thank you for responding. So, what about handling the timeout issue? Can it resolve itself?

@fontebasso
Copy link
Contributor

@imphunq, I saw your question and thought it might still be helpful to clarify a few things, even if some time has passed.

If the timeout you mentioned is related to the connection with RabbitMQ, it's common for the php-amqplib library to throw an exception when that happens. In most cases, this will cause the Laravel worker process (php artisan queue:work rabbitmq) to stop running.

For production setups, a solid approach is to run your queue worker inside a container, with the worker process as the main entrypoint. That way, if it crashes due to a connection issue or timeout, an orchestrator like Kubernetes or HashiCorp Nomad can restart it automatically.

Hope this helps clarify things a bit. If you were referring to a different kind of timeout, let me know and we can dig deeper into it together.

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

3 participants