Description
Apache OpenWebBeans (OWB) is a IoC container implementing CDI (Java Contexts and Dependency Injection) specification.
With the rise of Kubernetes and more generally the Cloud adoption, it becomes more and more key to be able to have fast, light and reliable servers.
That ecosystem is mainly composed of Microprofile servers.
However their stack is quite huge for most applications and OpenWebBeans-based Microprofile server are not CDI centric (Meecrowave and TomEE are Tomcat centric).
This is why the need of a light HTTP server (likely Netty based), embeddable in CDI context (as a bean) comes.
It will be close to a light embedded servlet container but likely more reactive in the way the server will need to scale.
It must handle fixed size payload (with Content-Length header) but also chunking.
This task will require:
- define a lightweight HTTP API
- start with the most essential features
- at least supporting filter like interception, even interceptor based but in a reactive fashion (CompletionStage)
- optional, if there is enough time left: add features like fileupload support
- implement the API (marry our API / CDI / OWB / Netty)
- make it configurable
- via code / builder pattern
- optional, if there is enough time left: via Micoprofile Config
Once this light server is ready, the next step for a Java application to embrace the cloud is to make it native runnable.
Today OWB generates the class proxies, which are required per CDI specs to enable features like Interception and Decoration, lazy in runtime-mode.
A native-image can be generated via the "native-image" cmd tool from GraalVM, where you can include the classpath. This classpath must contain the generated class-proxies as the generated nativeimage can't generate bytecode anymore.
It's not a trivial task to enable OWB to create proxies in buildtime.
This task will require:
- change the "dynamic" classname generation to "static", otherwise we can't rely on the classname when lookup the proxyclass
- implement a proxy SPI in OWB, to enable to load pre-generated proxies instead of generate them in runtime
- implement a BuildTimeProxyGenerator class
- it should accept a list of beans (bean class + interceptor classes + decorator classes)
- optional, if there is enough time left: later we can add a more complex solution which also scanns the classpath for beans
In scope of this project, it's enough to manually call the BuildTimeProxyGenerator via a Runnable (with a companion main(String[])) and add the generated proxies in the classpath of the "native-image" cmd.
You should know:
• Java
• HTTP
Difficulty: Major
mentors: tandraschko@apache.org, rmannibucau@apache.org
Potential mentors:
Project Devs, mail: dev (at) openwebbeans.apache.org
Attachments
1.
|
[After GSoC/Optional] enable Fileupload | Open | Unassigned | |
2.
|
[After GSoC] resolve execution at bootstrap or lazily | Open | Unassigned | |
3.
|
[After GSoC] enable Chunking for Http Response | Open | Unassigned | |
4.
|
[After GSoC] async server and CDI startup | Open | Unassigned | |
5.
|
[After GSoC] server configuration with properties file | Open | Unassigned |