php - Using the queue listener for xml messages -


i want retrieve messages pushed amazon in xml format via amazon sqs queue laravel 5.1's queue:listen command, error saying

argument 1 passed illuminate\queue\jobs\job::resolveandfire() must of type array, null given, called in /opt/phpstormprojects/amazon_requester/vendor/laravel/framework/src/illuminate/queue/jobs/sqsjob.php on line 52 , defined

so looked above class job called via fire method:

$this->resolveandfire(json_decode($this->getrawbody(), true)); 

the problem here json_decode(...) returns null, when dump message's data, xml response expected.

if change way listener handles response, couldn't update laravel anymore without breaking code, i'm in doubt if there's other way tell laravel how handle response?

laravel's queue expects queue items come laravel. queue items contain json payload info on handler run, data pass it, etc. if want listen amazon-created queue items, you'll need not use laravel queue system , access sqs via aws sdk php directly.


Comments