-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add a POJA serverless implementation based on Apache #773
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is currently using rawhttp as parser. I will change it soon to use a more widely used parser. I am able to test a sample Micronaut application with this module. The sample can be found in samples/ dir along with its own README and build script. I can see the app working both in interactive mode as well as inetd mode. Here's the plan before PR is submitted: 1. Use a more widely used parser. 2. Add test cases and samples for http-serverless module. 3. Fix TODOs in code. 4. Run compatibility tests for micronaut. 5. Update gcn/micronaut launcher to allow users to select the new serverless option.
The test uses pipes to communicate with the server instead of STDIN and STDOUT and currently sends requests and receives responses as text, which can be improved.
- Add support for getting the body from the RawHttpRequest - Add support for reading cookies from the request
- Add a LimitingInputStream to improve body support. The stream does not allow reading after content length has been read. - Refactor into common base classes and specific RawHttp implementation that could be replaced.
- Fix the input stream reading for tests. - Remove the transfer encoding header
- Make sure byte data is preserved - Fix getting header that is missing
- Make the PojaHttpRequest mutable for filters. - Make sure that headers are standardized to upper case. - Allow binding byte[] body. - Move the common testing logic to the http-poja-test module. - Use limiting input stream on the whole body to make sure too many bytes are not read.
- Remove unneeded dependency. - Fix for header reading. - Fix for reading input stream by limiting it with content length.
Fix header standardization method and refactor header and query parameters to separate classes
andriy-dmytruk
force-pushed
the
andriy/poja-apache
branch
from
August 16, 2024 18:44
aa9f232
to
5a6975b
Compare
andriy-dmytruk
changed the title
[WIP] Add a POJA serverless implementation based on Apache
Add a POJA serverless implementation based on Apache
Aug 19, 2024
graemerocher
requested changes
Aug 19, 2024
test-sample-poja/src/main/java/io/micronaut/http/poja/sample/Application.java
Outdated
Show resolved
Hide resolved
http-poja-apache/src/main/java/io/micronaut/http/poja/llhttp/ApacheServerlessApplication.java
Outdated
Show resolved
Hide resolved
http-poja-apache/src/main/java/io/micronaut/http/poja/llhttp/ApacheServerlessApplication.java
Outdated
Show resolved
Hide resolved
http-poja-apache/src/main/java/io/micronaut/http/poja/llhttp/ApacheServletHttpRequest.java
Outdated
Show resolved
Hide resolved
http-poja-apache/src/main/java/io/micronaut/http/poja/llhttp/ApacheServletHttpRequest.java
Outdated
Show resolved
Hide resolved
http-poja-apache/src/main/java/io/micronaut/http/poja/llhttp/ApacheServletHttpRequest.java
Outdated
Show resolved
Hide resolved
http-poja-apache/src/main/java/io/micronaut/http/poja/llhttp/ApacheServletHttpRequest.java
Outdated
Show resolved
Hide resolved
http-poja-apache/src/main/java/io/micronaut/http/poja/llhttp/ApacheServletHttpResponse.java
Outdated
Show resolved
Hide resolved
if you can try address the sonar code quality checks as well would be great. Thanks |
Handle the case of a bad request where it could not be parsed. The server should not break, but return a 400 response. Also implement other review comments.
Quality Gate failedFailed conditions |
graemerocher
approved these changes
Aug 19, 2024
andriy-dmytruk
added a commit
that referenced
this pull request
Aug 20, 2024
…ache-4.9.x Revert "Merge pull request #773 from micronaut-projects/andriy/poja-apache
This was referenced Aug 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The idea of this module is to provide a solution that is able to parse simple requests and give simple responses using System
STDIN
andSTDOUT
instead of networking. The common logic is present in thehttp-poja-common
and there is a particular Apache implementation inhttp-poja-apache
.This is an improvement of #748 PR that uses a more commonly-used library instead of RawHTTP. The common module can be used for implementing other clients relatively easily, though.
There is a TCK that is passing for the created module.