php – Send file contents to RabbitMQ
Here is my code to send file content to queue:
$documentToSend = ['file' => file_get_contents($filePath)];
Queue calling:
Queue::pushRaw(json_encode($documentToSend), 'service-call');
Here is my queue handle:
public function handle(){
try {
$file = $this->data->file;
Storage::disk()->put($fileToPath, $file, 'public');
} catch (Exception $e) {
Log::error($e);
}
}
Getting nothing in error nor any data.
Can anyone guide me?
Read more here: Source link
