-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't access HTTP request body in java11-vert-x template. #255
Comments
…aas#255 Signed-off-by: Patrik Fortier <[email protected]>
Hi, thanks for your interest in OpenFaaS. Under "Steps to Reproduce (for bugs)", please could you create a Github repo that shows how to reproduce this issue? Thanks |
Hi @alexellis 👋 I edit the issue, adding a Github repo showcasing the issue I wanted to report with logs from my deployment. The issue stated is wrong since
Thanks for the quick reply ! |
No problem. That helps a lot. Can you see my comment on the PR please? |
Expected Behaviour
When building a function using the
java11-vert-x
template, i should be able to access the HTTP request body from theRoutingContext
object.Current Behaviour
Recovering body using Vertx API e.g
routingContext.getBody()
raises aNullPointerException
because the routingContext object isn't populated with the HTTP request body.Possible Solution
Adding a
BodyHandler
object to the Vertx router handlers will populate theRoutingContext
and fix the issue.Steps to Reproduce (for bugs)
link to a live example: https://github.com/p-fortier/openfaas-java11-showcase
java11-vert-x
templatesrc/main/java/com/openfaas/function/Handler.java
. e.g usingSystem.out.println(routingContext.getBody());
3'. edit: no exception raised in this scenario, no http 500. logs inside showcase shows empty context
2021/04/06 08:21:48 stdout: null
Context
I was building an OpenFaaS workflow using faas-flow and
java11-vert-x
template.My goal was to build a workflow processing data from function to function.
This issue prevented me from recovering the HTTP request body in any function.
Your Environment
Not relevant.
The text was updated successfully, but these errors were encountered: