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

Jetty 9.x will be soon no more maintained #1662

Open
sbernard31 opened this issue Oct 23, 2024 · 6 comments
Open

Jetty 9.x will be soon no more maintained #1662

sbernard31 opened this issue Oct 23, 2024 · 6 comments
Labels
bsserver Impact LWM2M bootstrap server demo Impact our demo (not libraries) housekeeping Refactoring, cleaning code or API server Impact LWM2M server

Comments

@sbernard31
Copy link
Contributor

sbernard31 commented Oct 23, 2024

Jetty 9/10/11 all go full EOL on January 1, 2025. (no more updates)

source :

The only supported one will be v12 which use 17 as minimum version ...

So either :

  • we migrate to v12 which will lead to a painful situation where we have different java constraint by leshan component ... 😞
  • we don't migrate this is just a demo (I do not like so much this one)
  • we find an alternative which is compliant with java8

( When we will remove jetty 9.x dependencies, we should remove corresponding CVE in .trivyignore)

Library issue
Jetty 12 requires java 17+
HttpServer (from JDK) No SSE, Static resource since java18
Undertow need java 11 since 2.3
nanoHttpD no more maintained
Tiny Java Web Server hosted on sourceforce 😱
Netty Netty 4 support java8 but for how long it will be maintained ? and sounds strange to use netty for implementing a simple Http Server and no SSE API 🤔. Note that we already use Netty 4 for coap+tcp
@sbernard31 sbernard31 added server Impact LWM2M server demo Impact our demo (not libraries) bsserver Impact LWM2M bootstrap server housekeeping Refactoring, cleaning code or API labels Oct 23, 2024
@jvermillard
Copy link
Contributor

jvermillard commented Oct 23, 2024

Another alternative is to use the HTTP server in the JDK:
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.httpserver/com/sun/net/httpserver/HttpServer.html
It's here since forever (1.6?) in the com.sun.* namespace but since https://openjdk.org/jeps/408 in java 18 it's pretty sure it will not go away

@sbernard31
Copy link
Contributor Author

sbernard31 commented Oct 23, 2024

@jvermillard thx for sharing this !

I think if we can remove a useless dependencies this is a good thing.
Do you know if there is any support of Server Sent Event ? (I will not be surprised if there was no support of it)

@jvermillard
Copy link
Contributor

never tried: https://stackoverflow.com/questions/67915286/java-sse-server-with-com-sun-net-httpserver-httpserver
another option is long polling which should work for sure

@sbernard31
Copy link
Contributor Author

sbernard31 commented Oct 25, 2024

I take a look at HttpServer there is nothing to serve static resources in java8.
They add something like that with java18.

Of course we could implement our own HttpHandler which do that but if we need to re-code everything(static resource, SSE, ...) not sure this is a good move. (Especially from a security point of view)

Too bad, I liked this idea to use JDK directly 😞

@sbernard31
Copy link
Contributor Author

sbernard31 commented Oct 29, 2024

As I didn't find any good solution... I currently consider to migrate to jetty 12 and so have different minimum java constraint. (not sure how this will affect the build, theoretically not so much as we didn't have any tests based on jetty)

This is not ideal but I'm afraid that it will be hard to keep to java8 for all leshan module anyway because more and more libraries move to java 11 or 17... I mean I will not surprised if in the future java minimal version is not the same for each transport layer implementation... 😞

I try to fight against the idea at the back of my mind, that maybe using HttpServer from JDK and write support of SSE and static resource on my own is not so much of code. 😅

@sbernard31
Copy link
Contributor Author

A try to move to jetty 12 : #1667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bsserver Impact LWM2M bootstrap server demo Impact our demo (not libraries) housekeeping Refactoring, cleaning code or API server Impact LWM2M server
Projects
None yet
Development

No branches or pull requests

2 participants