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

Refactor move jetty into separate module, add JDK http service implementation module #22

Merged
merged 27 commits into from
Jul 16, 2021

Conversation

rbygrave
Copy link
Contributor

@rbygrave rbygrave commented Jul 9, 2021

JDK comes with a basic http service. Adds a separate jex implementation based on that with some current limitations (no multipart file upload support, no session support, currently no cookie support although we should be able to add that).

@rbygrave rbygrave changed the title Refactor move jetty into separate module Refactor move jetty into separate module, add JDK http service implementation module Jul 11, 2021
@tipsy
Copy link
Collaborator

tipsy commented Jul 12, 2021

Interesting stuff. Is the long term goal to get rid of jetty completely, or to offer multiple jex flavors for different needs?

@rbygrave
Copy link
Contributor Author

multiple jex flavors for different needs?

The Jex JDK server is approx 80K + JDK http server + the only other dependency being logging (logback or log4j etc) so it is very lightweight. The use cases where we will look to use this is for services that are largely doing messaging (ActiveMQ / Kafka etc). For these services we are effectively only using the http endpoints for kubernetes liveness, readiness probes + metrics reporting.

The Jex JDK server does not support file uploads, websockets, sse and sessions but that is ok for these services.

The other potential use case I have in mind would be small graal native-image rest servers.

@rbygrave
Copy link
Contributor Author

get rid of jetty completely

I did some quick performance tests of Jetty, Undertow and Netty. Undertow was just a touch faster than Jetty with Netty (using Helidon SE) the slowest for my test. All pretty similar really. The summary is that Jetty is still imo a really really good choice when we want a serious http server - especially with the way Loom is going to work. With Undertow, Netty we need a separate second thread pool beyond their worker pools which is ok but Jetty is just going to be easy with Loom.

@tipsy
Copy link
Collaborator

tipsy commented Jul 12, 2021

The Jex JDK server is approx 80K + JDK http server + the only other dependency being logging (logback or log4j etc) so it is very lightweight. The use cases where we will look to use this is for services that are largely doing messaging (ActiveMQ / Kafka etc). For these services we are effectively only using the http endpoints for kubernetes liveness, readiness probes + metrics reporting.

Makes sense!

I did some quick performance tests of Jetty, Undertow and Netty. Undertow was just a touch faster than Jetty with Netty (using Helidon SE) the slowest for my test. All pretty similar really. The summary is that Jetty is still imo a really really good choice when we want a serious http server - especially with the way Loom is going to work. With Undertow, Netty we need a separate second thread pool beyond their worker pools which is ok but Jetty is just going to be easy with Loom.

Glad to see you arrive at this conclusion too. As much as I dislike Jetty's API, I think it's a solid general purpose webserver, and I'm pretty much married to it at this point :)

@rbygrave rbygrave self-assigned this Jul 14, 2021
@rbygrave rbygrave added this to the 2.0 milestone Jul 14, 2021
@rbygrave rbygrave merged commit cac4c74 into master Jul 16, 2021
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.

None yet

2 participants