Skip to content
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
merged 39 commits into from
Aug 19, 2024

Conversation

andriy-dmytruk
Copy link
Contributor

@andriy-dmytruk andriy-dmytruk commented Aug 15, 2024

The idea of this module is to provide a solution that is able to parse simple requests and give simple responses using System STDIN and STDOUT instead of networking. The common logic is present in the http-poja-common and there is a particular Apache implementation in http-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.

wwwsahoo and others added 25 commits August 16, 2024 14:43
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 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
Copy link
Contributor

if you can try address the sonar code quality checks as well would be great. Thanks

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
58.8% Coverage on New Code (required ≥ 70%)

See analysis details on SonarCloud

@andriy-dmytruk andriy-dmytruk merged commit ca7cfb9 into 4.9.x Aug 19, 2024
16 of 17 checks passed
@andriy-dmytruk andriy-dmytruk deleted the andriy/poja-apache branch August 19, 2024 21:48
andriy-dmytruk added a commit that referenced this pull request Aug 20, 2024
…pache"

This reverts commit ca7cfb9, reversing
changes made to fbeccc4.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants