-
-
Notifications
You must be signed in to change notification settings - Fork 556
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
Minimize Jetty Coupling #2164
Comments
Speaking for myself: Why add this functionality? I get the feeling that people are coding against Javalin. They don't care what the underlying server is. Why would they want to swap it? What would the benefit be? On the negative side, adding a layer of abstraction will introduce complexity and weight to Javalin. Sometimes it's best to just "lean in". For example, how often do people swap database types? Almost never. One of the reasons that Hibernate is a heavy beast is that they attempt to abstract away the database. If they were to "lean in" the library would be lighter, faster, and could use implementation-specific functionality that is not available on other databases. |
I largely agree with @cowwoc, this is very expensive for what it brings to the average Javalin developer. Someone in the community would have to step up and commit to this. |
I see this simply as technical debt, right now the very reason why we can't update to Jetty 12 is this, we're using internal jetty classes and APIs that have break Javalin during the update. This is not new, we had the very same issue with the HTTP/2 ALPN situation in #2084. We're relying on some Jetty internals that weren't designed or expected to be relied upon, something that one of their developers pointed out in the jetty 12 (#2158) PR. I don't intend to stop using Jetty, but most of our functionality is already independent from it, and the Servlet we create is quite functional. |
With respect to using internal classes, given that Jetty uses Java Modules they shouldn't be exporting any internal classes. If they are, I would consider it a bug in their end... you might want to clarify with them what happened in this case to avoid future problems. |
Maybe I can help to clarify a few things here, because this is quite high level overview of the Jetty related issues, and it touches several areas. Just before we start, I'd like to highlight that this request is not about removing Jetty support or anything like that - I want to make that clear, because I know some people reading this thread may miss the point here and be a bit worried :)
I'd personally say that the initial/main cause that leads us into this whole discussion is not about adding new functionality, but about maintenance, technical aspects related to the mixed implementation we have in the core module and separation of concerns. If we remove any references to alternative http server from this ticket description, the motivation behind implementing part of these changes is still valid.
I think there are different types of abstractions and blending it all together does not reflect the desired state. Adding the abstraction layer may lead to increased complexity when you're trying to support some sort of functionality in a very generic way etc., but in terms of this refactor, we'd like to just move Jetty-related complexity out of the core module, so we can actually keep our implementation as simple as possible. For instance, using Jetty's resource handler and our own request handler forces us to implement static files as a special edge case of the whole request handler. You could probably say "it's just one place, probably good enough"... well, the problem here is that if we're mixing Javalin "way" of doing things on our side, and party doing it via Jetty's implementation, we're kinda desynchronizing the actual state and propagating this to upper layers. It's sometimes hard to implement features that are fully safe by design, because we're sometimes uncertain about the current state.
Assuming that the support for an alternative http server is a thing, I'd say it's encouraging people to stay with Javalin, because you can use Javalin's API without being bounded to a specific server. Speaking about the benefits - it simply depends on the use-case and what's your goal or issues you have with the existing server. It'd require to go deeper into more technical details, so maybe I'll stop on mentioning those 2 completely random examples:
I'm not sure if this is the case here. It wouldn't be about swapping a server for existing applications, but rather a possibility to actually start using Javalin in a project where, for some reason, you need a specific http server due to its benefits.
I think Hibernate is just bad, and generalized access to sql dialect is one of the least of its problems 💔 |
My two cents in this discussion. Please keep it as light as possible. |
While we leverage the Servlet API for compatibility, some areas of our codebase are tightly coupled to Jetty-specific implementations (like #2157). This issue aims to identify these dependencies to improve flexibility and maintainability.
Goals:
Discussion Points:
Identified Coupling Points
MimeTypes
class.ResourceHandler
,Resource
, and related classes.Session
API.org.eclipse.jetty.ee9.nested.*
).The text was updated successfully, but these errors were encountered: