christoph-kluge / bref-sqs-laravel Goto Github PK
View Code? Open in Web Editor NEWServerless laravel queues on AWS Lambda (SQS driver)
License: MIT License
Serverless laravel queues on AWS Lambda (SQS driver)
License: MIT License
Hey @christoph-kluge. Thanks for the solution.
However, there is an error when doing composer require christoph-kluge/bref-sqs-laravel
@php artisan package:discover --ansi
Unresolvable dependency resolving [Parameter #3 [ <required> callable $isDownForMaintenance ]] in class Illuminate\Queue\Worker {"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Unresolvable dependency resolving [Parameter #3 [ <required> callable $isDownForMaintenance ]] in class Illuminate\\Queue\\Worker at /home/vagrant/Code/web-dashboard/vendor/laravel/framework/src/Illuminate/Container/Container.php:993)
If I chain multiple jobs together then the worker throws the following error:
[2021-03-04 16:14:36] staging.ERROR: Call to a member function bound() on null {"exception":"[object] (Error(code: 0): Call to a member function bound() on null at /var/task/vendor/laravel/framework/src/Illuminate/Queue/Queue.php:344)
[stacktrace]
#0 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(312): Illuminate\\Queue\\Queue->raiseJobQueuedEvent()
#1 /var/task/vendor/laravel/framework/src/Illuminate/Support/helpers.php(263): Illuminate\\Queue\\Queue->Illuminate\\Queue\\{closure}()
#2 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(313): tap()
#3 /var/task/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php(99): Illuminate\\Queue\\Queue->enqueueUsing()
#4 /var/task/vendor/christoph-kluge/bref-sqs-laravel/src/Queue/Queue.php(46): Illuminate\\Queue\\SqsQueue->push()
#5 /var/task/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(251): Sikei\\Bref\\Sqs\\Laravel\\Queue\\Queue->push()
#6 /var/task/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(227): Illuminate\\Bus\\Dispatcher->pushCommandToQueue()
#7 /var/task/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(77): Illuminate\\Bus\\Dispatcher->dispatchToQueue()
#8 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php(202): Illuminate\\Bus\\Dispatcher->dispatch()
#9 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(389): Illuminate\\Foundation\\Bus\\PendingDispatch->__destruct()
#10 /var/task/vendor/laravel/framework/src/Illuminate/Bus/Queueable.php(233): dispatch()
#11 /var/task/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(166): App\\Jobs\\SomeJob->dispatchNextJobInChain()
#12 /var/task/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(77): Illuminate\\Queue\\CallQueuedHandler->ensureNextJobInChainIsDispatched()
#13 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call()
#14 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(406): Illuminate\\Queue\\Jobs\\Job->fire()
#15 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(356): Illuminate\\Queue\\Worker->process()
#16 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(307): Illuminate\\Queue\\Worker->runJob()
#17 /var/task/vendor/christoph-kluge/bref-sqs-laravel/src/Commands/SqsWorkCommand.php(77): Illuminate\\Queue\\Worker->runNextJob()
#18 /var/task/vendor/bref/bref/src/Runtime/Invoker.php(34): Sikei\\Bref\\Sqs\\Laravel\\Commands\\SqsWorkCommand->Sikei\\Bref\\Sqs\\Laravel\\Commands\\{closure}()
#19 /var/task/vendor/bref/bref/src/Runtime/LambdaRuntime.php(102): Bref\\Runtime\\Invoker->invoke()
#20 /var/task/vendor/christoph-kluge/bref-sqs-laravel/src/Commands/SqsWorkCommand.php(81): Bref\\Runtime\\LambdaRuntime->processNextEvent()
#21 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(100): Sikei\\Bref\\Sqs\\Laravel\\Commands\\SqsWorkCommand->runWorker()
#22 /var/task/vendor/christoph-kluge/bref-sqs-laravel/src/Commands/SqsWorkCommand.php(57): Illuminate\\Queue\\Console\\WorkCommand->handle()
#23 /var/task/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Sikei\\Bref\\Sqs\\Laravel\\Commands\\SqsWorkCommand->handle()
#24 /var/task/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#25 /var/task/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#26 /var/task/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#27 /var/task/vendor/laravel/framework/src/Illuminate/Container/Container.php(610): Illuminate\\Container\\BoundMethod::call()
#28 /var/task/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call()
#29 /var/task/vendor/symfony/console/Command/Command.php(256): Illuminate\\Console\\Command->execute()
#30 /var/task/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run()
#31 /var/task/vendor/symfony/console/Application.php(971): Illuminate\\Console\\Command->run()
#32 /var/task/vendor/symfony/console/Application.php(290): Symfony\\Component\\Console\\Application->doRunCommand()
#33 /var/task/vendor/symfony/console/Application.php(166): Symfony\\Component\\Console\\Application->doRun()
#34 /var/task/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\\Component\\Console\\Application->run()
#35 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
#36 /var/task/worker.php(15): Illuminate\\Foundation\\Console\\Kernel->handle()
#37 /var/task/vendor/bref/bref/src/Runtime/FileHandlerLocator.php(43): require('/var/task/worke...')
#38 /opt/bref/bootstrap.php(32): Bref\\Runtime\\FileHandlerLocator->get()
#39 {main}
"}
I am using Laravel 8.29.0 and the current version of this package 1.0.0.
I haven't had time to look at the problem in detail yet, but I thought I could at least share my stack trace.
I replaced the real job class name with SomeJob
, the rest of the stack trace was not edited.
I am currently using your plugin and it is working perfectly for me thanks.
The only problem I have now is that I want to update to the current bref version, but I cannot do that because your package requires bref version 0.*
.
Would it be possible to make this package work with bref 1.*
.
If you want I can test the new version in our staging environment.
Hey, first of all thanks for the package.
I am using it to run workers with Bref on AWS, however my queue is getting the following errors in cloud watch:
[2020-01-28 08:45:16] local.ERROR: Error executing "DeleteMessage" on "https://sqs.us-east-1.amazonaws.com/your-account-id/sqs/your-queue-name"; AWS HTTP error: Client error: `POST https://sqs.us-east-1.amazonaws.com/your-account-id/sqs/your-queue-name` resulted in a `403 Forbidden` response:
All my env variables are in place, if I dump $_SERVER and $_ENV in my job that is run, they are all there.
The error seems to be caused when the job is finished and SqsJob tries to remove the meesage from the queue.
I think it is related to SqsWorkCommand
in your package, but I haven't had the change to debug it further.
I tried to use this plugin with Laravel 8, but I get the following error:
errorMessage | The "name" option does not exist.
-- | --
errorType | Symfony\Component\Console\Exception\InvalidArgumentException
stack.0 | #0 /var/task/vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithIO.php(111): Symfony\Component\Console\Input\Input->getOption()
stack.1 | #1 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(128): Illuminate\Console\Command->option()
stack.2 | #2 /var/task/vendor/christoph-kluge/bref-sqs-laravel/src/Commands/SqsWorkCommand.php(68): Illuminate\Queue\Console\WorkCommand->gatherWorkerOptions()
stack.3 | #3 /var/task/vendor/bref/bref/src/Runtime/Invoker.php(34): Sikei\Bref\Sqs\Laravel\Commands\SqsWorkCommand->Sikei\Bref\Sqs\Laravel\Commands\{closure}()
stack.4 | #4 /var/task/vendor/bref/bref/src/Runtime/LambdaRuntime.php(102): Bref\Runtime\Invoker->invoke()
stack.5 | #5 /var/task/vendor/christoph-kluge/bref-sqs-laravel/src/Commands/SqsWorkCommand.php(72): Bref\Runtime\LambdaRuntime->processNextEvent()
stack.6 | #6 /var/task/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(100): Sikei\Bref\Sqs\Laravel\Commands\SqsWorkCommand->runWorker()
stack.7 | #7 /var/task/vendor/christoph-kluge/bref-sqs-laravel/src/Commands/SqsWorkCommand.php(53): Illuminate\Queue\Console\WorkCommand->handle()
stack.8 | #8 /var/task/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Sikei\Bref\Sqs\Laravel\Commands\SqsWorkCommand->handle()
stack.9 | #9 /var/task/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
stack.10 | #10 /var/task/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
stack.11 | #11 /var/task/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
stack.12 | #12 /var/task/vendor/laravel/framework/src/Illuminate/Container/Container.php(610): Illuminate\Container\BoundMethod::call()
stack.13 | #13 /var/task/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Container\Container->call()
stack.14 | #14 /var/task/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute()
stack.15 | #15 /var/task/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()
stack.16 | #16 /var/task/vendor/symfony/console/Application.php(971): Illuminate\Console\Command->run()
stack.17 | #17 /var/task/vendor/symfony/console/Application.php(290): Symfony\Component\Console\Application->doRunCommand()
stack.18 | #18 /var/task/vendor/symfony/console/Application.php(166): Symfony\Component\Console\Application->doRun()
stack.19 | #19 /var/task/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()
stack.20 | #20 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
stack.21 | #21 /var/task/worker.php(15): Illuminate\Foundation\Console\Kernel->handle()
stack.22 | #22 /var/task/vendor/bref/bref/src/Runtime/FileHandlerLocator.php(43): require('/var/task/worke...')
stack.23 | #23 /opt/bref/bootstrap.php(32): Bref\Runtime\FileHandlerLocator->get()
stack.24 | #24 {main}
I will try to look into this further in the following days, but any tips from your side would help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.