-
Notifications
You must be signed in to change notification settings - Fork 895
[RESTEASY-3583] Add a ServiceLoader dev.resteasy.embedded.server.UndertowBuilderConfigurer to update the Undertow.Builder #4510
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
Conversation
|
I'm not opposed to this at all. I'm just going to look if there is a generic way we could do this so that other embedded servers can also use an API like this. |
|
Well, my gut says that going general would either go against strongly typed, or against KISS… On the one hand, if you made an interface that took an Object, you'd have to cast it to see what it was, and on the other, you'd have an interface with each possible type. Of course, there may be there's a technique I can't think of but I'm leaning towards each of the servers having their own, strongly typed, interfaces - any libraries that wanted to extend several could just have ServiceLoader entries for each as separate libs, or all in one at their discretion. I like the each as separate libs in the spirit of composition and because it would also keep extraneous dependencies to a minimum. |
|
Yeah. I was looking for a way to make it part of the API, but there's not really a way to do that without breaking changes and it's not worth it. We require all contributions to be made under the terms of the ASL 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 |
...teasy-undertow-cdi/src/main/java/dev/resteasy/embedded/server/UndertowBuilderConfigurer.java
Outdated
Show resolved
Hide resolved
...teasy-undertow-cdi/src/main/java/dev/resteasy/embedded/server/UndertowBuilderConfigurer.java
Outdated
Show resolved
Hide resolved
...teasy-undertow-cdi/src/main/java/dev/resteasy/embedded/server/UndertowBuilderConfigurer.java
Outdated
Show resolved
Hide resolved
...teasy-undertow-cdi/src/main/java/dev/resteasy/embedded/server/UndertowCdiEmbeddedServer.java
Outdated
Show resolved
Hide resolved
Yes, I agree |
jamezp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @scr-oath, thank you! Could you squash this down to a single commit? Sorry, I completely forgot to say something in the initial review.
Our preference is to have logical commits as a single commit into the main branch.
Also, once complete I'll create a PR for this in 6.2 as well.
I don't want to fight the norm, because I'm eager for this improvement so we can use in other projects that were firing up the container with MANY more lines of application code 😉 DONE |
…r.UndertowBuilderConfigurator to update the Undertow.Builder
22914e5 to
6683375
Compare
Awesome - yes, we're using the latest .Final version (6.2). |
|
Hey… it would seem that, by default Undertow doesn't hook up its compression handler for responses, so this technique can be used to do that too. Any ETA for the next release that would include this feature with it? |
|
I'm hoping to get it done this week. Sorry for the delay. |
|
I see it landed today 🎉 thanks! |
|
Yes, sorry for the delay. Last week ended up getting away from me. |
This implements a simple ServiceLoader interface, which can be used by applications, which need to update the Undertow.Builder before it is built/started (such as, to add http2 support to a non-TLS server).