client_java icon indicating copy to clipboard operation
client_java copied to clipboard

Jakarta Servlet 5.0

Open halset opened this issue 5 years ago • 7 comments

Looks like servlet-api are moving to jakarta package names. Any plans for upgrading client_java to support it? It will probably take several years before everyone is over, so perhaps we need parallel releases?

https://jakarta.ee/specifications/servlet/5.0/

halset avatar Dec 17 '20 09:12 halset

What would it involve? Is there something in there that would break existing users of it? What would be the benefits? This library supports back to Java 6, so that has to be kept working.

brian-brazil avatar Dec 17 '20 10:12 brian-brazil

There are new package names for the servlet stuff. The new API uses jakarta.servlet instead of javax.servlet.

Perhaps copying over simpleclient_servlet to simpleclient_servlet-servetletapi5 and let the user choose?

Or people can just create their own copy of the MetricsServlet using the new API. Luckily, it is very small.

halset avatar Dec 17 '20 11:12 halset

If it's just a rename then I would presume that there's an adapter out there for it. We already have quite a few different HTTP exposition options, i'd rather not add more if we don't have to.

brian-brazil avatar Dec 17 '20 11:12 brian-brazil

Okay. I do not think it is just a rename, but there are not other changes for MetricsServlet at least. Not fixing this here is fine with me as I can just have my own copy of MetricsServlet with this change locally in each project. This is quite new to me as I just discovered this by reading up on jetty 10 and jetty 11.

halset avatar Dec 17 '20 12:12 halset

I'd recommend against copying, as this code will be changing in the near future to handle OpenMetrics negotiation.

brian-brazil avatar Dec 17 '20 12:12 brian-brazil

We have a similar situation in our project as we are moving from javax.* (Jetty 9.x ) to jakarta.* (Jetty 11) . We use the simpleclient_servlet jar which use javax.. The quick solution for us would be to copy and refactor the import statements to use jakarta. instead of javax.*. However we would prefer to use a new simpleclient_servlet_jakarta. It would be great if we can have client with jakarta support. Thanks in adavance.

lfgod avatar Dec 18 '20 13:12 lfgod

I have created the pull request https://github.com/prometheus/client_java/pull/647 for this.

mmadoo avatar Apr 02 '21 19:04 mmadoo

Is there any chance we could get this PR merged? Thanks -- Jon

jonathanl-telenav avatar Nov 11 '22 23:11 jonathanl-telenav

Isn't it this one? Or am I confusing things? https://github.com/prometheus/client_java/tree/main/simpleclient_servlet_jakarta

fstab avatar Nov 12 '22 09:11 fstab

thanks!

jonathanl-telenav avatar Nov 12 '22 21:11 jonathanl-telenav