Open jordandobrev opened 19 hours ago
No, returning non 200 response won't cause the Lambda invoke to fail. You need to through an exception to crash the runtime.
That works thanks! However it was not trivial to make it work with some languages like php with laravel for example. Just throwing an exception will be automatically handled in some cases and converted to a 500 http error. Even if you manage to get the php process to throw the exception anyway and kill the process, it's not the one that runs the environment really as you need an http server. The only way to do that was to locate the main parent process id and to do a pkill on it and wait, as if anything is returned before the parent process is killed it might not fail.
Hopefully there will be sth added in the future to simplify the flow via a response header or/and http status code.
I got your problem now. We could improve this for non-http event sources.
Hey guys, I have a trigger setup for kafka events - aws:kafka. When I return any non 200 response back from my \events endpoint it treats the execution as a success. That would prevent the automatic aws retry mechanism to kick in and will result in missed unprocessed messages.
Is there a way to return a response that would result in a lambda failure?