Skip to content

Conversation

@scr-oath
Copy link
Contributor

@scr-oath scr-oath commented Feb 17, 2025

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).

@scr-oath scr-oath requested a review from a team as a code owner February 17, 2025 18:39
@scr-oath scr-oath changed the title RESTEASY-3583 Add a ServiceLoader dev.resteasy.embedded.server.UndertowBuilderConfigurer to update the Undertow.Builder [RESTEASY-3583] Add a ServiceLoader dev.resteasy.embedded.server.UndertowBuilderConfigurer to update the Undertow.Builder Feb 17, 2025
@jamezp
Copy link
Member

jamezp commented Feb 19, 2025

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.

@scr-oath
Copy link
Contributor Author

scr-oath commented Feb 19, 2025

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.

@jamezp
Copy link
Member

jamezp commented Feb 20, 2025

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
Do you agree to these terms?

@scr-oath
Copy link
Contributor Author

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 Do you agree to these terms?

Yes, I agree

@scr-oath scr-oath requested a review from jamezp February 20, 2025 05:53
Copy link
Member

@jamezp jamezp left a 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.

@scr-oath
Copy link
Contributor Author

scr-oath commented Feb 20, 2025

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.

Sure, I can do that, but I'm curious before I do - is it not possible to choose Squash Merge? That can be preferable because it will leave this PR in tact to show the progression and not clobber/disconnect the relationships between reviewer comments against individual pushes to the PR…

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

@scr-oath scr-oath requested a review from jamezp February 20, 2025 16:06
…r.UndertowBuilderConfigurator to update the Undertow.Builder
@scr-oath scr-oath force-pushed the RESTEASY-3583-AddConfigurer branch from 22914e5 to 6683375 Compare February 20, 2025 16:12
@scr-oath
Copy link
Contributor Author

Also, once complete I'll create a PR for this in 6.2 as well.

Awesome - yes, we're using the latest .Final version (6.2).

@jamezp jamezp merged commit 2c40760 into resteasy:main Feb 20, 2025
11 checks passed
@scr-oath scr-oath deleted the RESTEASY-3583-AddConfigurer branch February 21, 2025 02:26
@scr-oath
Copy link
Contributor Author

scr-oath commented Mar 3, 2025

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?

@jamezp
Copy link
Member

jamezp commented Mar 5, 2025

I'm hoping to get it done this week. Sorry for the delay.

@scr-oath
Copy link
Contributor Author

I see it landed today 🎉 thanks!

@jamezp
Copy link
Member

jamezp commented Mar 12, 2025

Yes, sorry for the delay. Last week ended up getting away from me.

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.

2 participants