Pax-web HttpService async servlet registration

40 views
Skip to first unread message

Timothée Lemaire

unread,
Sep 20, 2022, 3:37:07 AM9/20/22
to OPS4J
Hello,

I'm trying to upgrade to karaf 4.4.x and face some issue regarding async support in servlet.

We are using the basic cxf servlet with basic pax HttpService. I'm not sure how things worked in pax 7, but as of pax 8.0.6 regardless of any OSGI configuration on cxf, async won't be enabled.

Apparently cxf register its servlet with the default parameters and hence passes additional parameters such as "async-supported" in the initParams map, where Pax's HttpServlet expect additional arguments.
ref : https://github.com/apache/cxf/blob/cxf-3.5.3/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java#L126

Is this voluntary or and unintended side effect ? Is there any possibility to take that into account (or could it be the case with more recent pax 8 releases ?) ? Or should i just do something more custom through extended HttpService or whiteboard ?

Thank you for you time,
Timothée Lemaire

Grzegorz Grzybek

unread,
Sep 20, 2022, 4:15:41 AM9/20/22
to op...@googlegroups.com
Hello


It also supports standard "osgi.http.whiteboard.servlet.asyncSupported" property and in Jetty case the value is then set into org.eclipse.jetty.servlet.Holder#_asyncSupported field.

Because the "legacy" version is used, you should see this in logs:

Legacy async-supported property specified, R7 osgi.http.whiteboard.servlet.asyncSupported property should be used instead

However, after checking further, CXF is passing the properties as "init parameters", and Pax Web 8 expects a service registration property. However, when using pure HttpService, there are no "service registration properties".
I can't see in Pax Web 7 where "async-supported" servlet init parameter is turned into actual flag set into the servlet holder... Did it work with Pax Web 7?

Anyway - for CXF case, I'll handle this init property as service registration property and set correct value for "async supported". See https://github.com/ops4j/org.ops4j.pax.web/issues/1767

regards
Grzegorz Grzybek

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/a10bc2c9-1a27-431e-ad26-9d3ff44f8a7an%40googlegroups.com.

Grzegorz Grzybek

unread,
Sep 20, 2022, 5:21:42 AM9/20/22
to op...@googlegroups.com
Hello

I've fixed https://github.com/ops4j/org.ops4j.pax.web/issues/1767 and I checked that CXF servlet is now registered as asynchronous. The fix should be available in 8.0.10 and 9.0.1.

regards
Grzegorz Grzybek

Timothée Lemaire

unread,
Sep 20, 2022, 10:32:19 AM9/20/22
to OPS4J
Hello Grzegorz,

Yes it did work with Pax Web 7, on Karaf 4.3. Although I'm not sure why or how.

I'll try to play arround with http whiteboard extention then. Otherwise I'll wait for new releases.

Thanks for the quick response, and quick "fix" !

Best Regards,
Timothée Lemaire
Reply all
Reply to author
Forward
0 new messages