HandleMessage.php 965 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace App\Jobs;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Queue\SerializesModels;
  5. use Illuminate\Queue\InteractsWithQueue;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Foundation\Bus\Dispatchable;
  8. use App\Http\Controllers\Fpdx\Message;
  9. class HandleMessage implements ShouldQueue
  10. {
  11. use Dispatchable;
  12. use InteractsWithQueue;
  13. use Queueable;
  14. use SerializesModels;
  15. protected $message;
  16. /**
  17. * Create a new job instance.
  18. *
  19. * @param string $message
  20. */
  21. public function __construct(string $message)
  22. {
  23. $this->message = $message;
  24. }
  25. /**
  26. * Execute the job.
  27. *
  28. * @return void
  29. */
  30. public function handle()
  31. {
  32. $msg = new Message();
  33. $message = simplexml_load_string($this->message);
  34. $msg->handleMsgTask($message);
  35. }
  36. /**
  37. * 要处理的失败任务
  38. */
  39. public function failed(Exception $exception)
  40. {
  41. }
  42. }