-
Notifications
You must be signed in to change notification settings - Fork 423
Exchange custom payloads between services instead of Job tasks #611
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
Comments
Try to explore on this. Not quite sure it related to your issue or not. |
For the consuming side you can create a custom job class as mentioned by @ALTELMA. For publishing you can just use the That would look something like this:
|
I've looked into the package a bit and the first solution that would work for me is to rewrite the default createPayload function in VladimirYuldashev\LaravelQueueRabbitMQ\Queue like this:
Contract example:
However, as far as I understand it is not enough and it will be necessary to implement your RabbitMQQQueue completely, because to leave compatibility with Horizon (it is a priority when choosing this package, autoscaling) need additional parameters that are in Laravel\Horizon\JobPayload. |
Sending the payload as a fully packaged task happens in the default queuing mode, where RabbitMQ acts as the queue. To send a custom payload, the Job should be modified to run directly (without "implements ShouldQueue"). In this case, the sending logic is placed inside handle(), making the job itself responsible for sending the message to RabbitMQ. pushRaw accepts "exchange", "exchange_type", and "persistent". However, this method lacks built-in support for "priority". Currently, this can be bypassed by adding "attempts" and setting 'prioritize_delayed' => true, or by including "data->command->priority" in the sent payload data - see method createMessage in VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue).
queue.php
|
Hi. I was considering the package as a means to interact with RabbitMQ, but found a nuance.
The package exchanges not pure payload, but whole laravel-job. Are there any plans to modernize the package so that it is possible to exchange pure payloads as well?
My motivation is that for Laravel and Golang interaction I will have to write a wrapper for Laravel on the Go side, which is not very productive.
Is there such a possibility now?
The text was updated successfully, but these errors were encountered: