From 3ff6cabddc594c2f55f6ca11b7b237d1a44f440e Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 2 Dec 2024 07:28:23 +0100 Subject: [PATCH] Deprecate HttpClientHTTPConduitFactory value of *.http-conduit-factory options, fix #1633 --- .../reference/extensions/quarkus-cxf.adoc | 8 ++++ .../ROOT/pages/release-notes/3.18.0.adoc | 42 +++++++++++++++++++ .../io/quarkiverse/cxf/doc/it/AntoraTest.java | 5 ++- .../io/quarkiverse/cxf/CxfClientConfig.java | 4 ++ .../io/quarkiverse/cxf/CxfFixedConfig.java | 4 ++ .../cxf/QuarkusHTTPConduitFactory.java | 8 ++++ 6 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 docs/modules/ROOT/pages/release-notes/3.18.0.adoc diff --git a/docs/modules/ROOT/pages/reference/extensions/quarkus-cxf.adoc b/docs/modules/ROOT/pages/reference/extensions/quarkus-cxf.adoc index 31d232e2e..dd3f9efbb 100644 --- a/docs/modules/ROOT/pages/reference/extensions/quarkus-cxf.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/quarkus-cxf.adoc @@ -488,6 +488,10 @@ use `io.vertx.core.http.HttpClient` as the underlying HTTP client. Since {quarku - `HttpClientHTTPConduitFactory`: the `HTTPConduitFactory` will be set to an implementation always returning `org.apache.cxf.transport.http.HttpClientHTTPConduit`. This will use `java.net.http.HttpClient` as the underlying HTTP client. ++ +*Deprecated since +xref:release-notes/3.18.0.adoc#_1633_httpclienthttpconduitfactory_value_of_http_conduit_factory_deprecated[3.18.0]* ++++-+++ use other `HTTPConduitFactory` implementations, preferably `QuarkusCXFDefault`. - `URLConnectionHTTPConduitFactory`: the `HTTPConduitFactory` will be set to an implementation always returning `org.apache.cxf.transport.http.URLConnectionHTTPConduit`. This will use `java.net.HttpURLConnection` as the underlying HTTP client. @@ -1911,6 +1915,10 @@ use `io.vertx.core.http.HttpClient` as the underlying HTTP client. Since {quarku - `HttpClientHTTPConduitFactory`: the `HTTPConduitFactory` for this client will be set to an implementation always returning `org.apache.cxf.transport.http.HttpClientHTTPConduit`. This will use `java.net.http.HttpClient` as the underlying HTTP client. ++ +*Deprecated since +xref:release-notes/3.18.0.adoc#_1633_httpclienthttpconduitfactory_value_of_http_conduit_factory_deprecated[3.18.0]* ++++-+++ use other `HTTPConduitFactory` implementations, preferably `QuarkusCXFDefault`. - `URLConnectionHTTPConduitFactory`: the `HTTPConduitFactory` for this client will be set to an implementation always returning `org.apache.cxf.transport.http.URLConnectionHTTPConduit`. This will use `java.net.HttpURLConnection` as the underlying HTTP client. diff --git a/docs/modules/ROOT/pages/release-notes/3.18.0.adoc b/docs/modules/ROOT/pages/release-notes/3.18.0.adoc new file mode 100644 index 000000000..bd5e43500 --- /dev/null +++ b/docs/modules/ROOT/pages/release-notes/3.18.0.adoc @@ -0,0 +1,42 @@ += {quarkus-cxf-project-name} 3.18.0 release notes + +== Important dependency upgrades + +* Quarkus 3.17.x -> 3.18.0 - https://quarkus.io/blog/quarkus-3-18-0-released/[release notes] + +== New features + +== Bugfixes + +== Deprecations + +=== https://github.com/quarkiverse/quarkus-cxf/issues/1633[#1633] `HttpClientHTTPConduitFactory` value of `*.http-conduit-factory` deprecated + +The `HttpClientHTTPConduitFactory` value of +`xref:reference/extensions/quarkus-cxf.adoc#quarkus-cxf_quarkus-cxf-http-conduit-factory[quarkus.cxf.http-conduit-factory]` +and `xref:reference/extensions/quarkus-cxf.adoc#quarkus-cxf_quarkus-cxf-client-client-name-http-conduit-factory[quarkus.cxf.client."client-name".http-conduit-factory]` +existed since the inception of those options in {quarkus-cxf-project-name} 2.3.0. + +`HttpClientHTTPConduit` never gained any real traction within {quarkus-cxf-project-name}. +When CXF started using it as a default, we were forced to introduce our own default (`URLConnectionHTTPConduitFactory`) +to avoid bugs like https://github.com/quarkiverse/quarkus-cxf/issues/992[#992], +https://issues.apache.org/jira/browse/CXF-8885[CXF-8885], +https://issues.apache.org/jira/browse/CXF-8951[CXF-8951], +https://issues.apache.org/jira/browse/CXF-8946[CXF-8946], +https://issues.apache.org/jira/browse/CXF-8903[CXF-8903] and possibly others. +Now that we have `VertxHttpClientHTTPConduit`, +which we can support very well on Quarkus, +there are no more reasons for us to spend our resources on `HttpClientHTTPConduit`. + +We should mark it as deprecated in our documentation, add some warnings on startup for the case that somebody is still using it and then at some point remove the item from the `io.quarkiverse.cxf.HTTPConduitImpl` enum and also remove the tests covering it. + + +== Documentation improvements + +* Removed dangling experimental status from `VertxHttpClientHTTPConduitFactory` in the ducumentation of + `xref:reference/extensions/quarkus-cxf.adoc#quarkus-cxf_quarkus-cxf-http-conduit-factory[quarkus.cxf.http-conduit-factory]` + and `xref:reference/extensions/quarkus-cxf.adoc#quarkus-cxf_quarkus-cxf-client-client-name-http-conduit-factory[quarkus.cxf.client."client-name".http-conduit-factory]` + +== Full changelog + +https://github.com/quarkiverse/quarkus-cxf/compare/3.17.2+++...+++3.18.0 diff --git a/docs/src/test/java/io/quarkiverse/cxf/doc/it/AntoraTest.java b/docs/src/test/java/io/quarkiverse/cxf/doc/it/AntoraTest.java index 8477446c0..1cfdbe610 100644 --- a/docs/src/test/java/io/quarkiverse/cxf/doc/it/AntoraTest.java +++ b/docs/src/test/java/io/quarkiverse/cxf/doc/it/AntoraTest.java @@ -39,9 +39,10 @@ public void externalLinks() { "http://www.w3.org/2009/xmlenc11#aes256-gcm"); final Set ignorables = new LinkedHashSet<>(ignorables1); - final ZonedDateTime deadline = ZonedDateTime.parse("2024-11-28T23:59:59+01:00[Europe/Paris]"); + final ZonedDateTime deadline = ZonedDateTime.parse("2025-01-28T23:59:59+01:00[Europe/Paris]"); if (ZonedDateTime.now(ZoneId.of("Europe/Paris")).isBefore(deadline)) { - ignorables.add("https://quarkus.io/blog/quarkus-3-17-0-released/"); + ignorables.add("https://quarkus.io/blog/quarkus-3-18-0-released/"); + ignorables.add("https://github.com/quarkiverse/quarkus-cxf/compare/3.17.2...3.18.0"); } AntoraTestUtils.assertExternalLinksValid(err -> ignorables.contains(err.uri())); diff --git a/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/CxfClientConfig.java b/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/CxfClientConfig.java index 9a4a4b2a5..af0583b6f 100644 --- a/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/CxfClientConfig.java +++ b/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/CxfClientConfig.java @@ -442,6 +442,10 @@ public interface CxfClientConfig { * - `HttpClientHTTPConduitFactory`: the `HTTPConduitFactory` for this client will be set to an implementation always * returning `org.apache.cxf.transport.http.HttpClientHTTPConduit`. This will use `java.net.http.HttpClient` as the * underlying HTTP client. + * + + * *Deprecated since + * xref:release-notes/3.18.0.adoc#_1633_httpclienthttpconduitfactory_value_of_http_conduit_factory_deprecated[3.18.0]* + * +++-+++ use other `HTTPConduitFactory` implementations, preferably `QuarkusCXFDefault`. * - `URLConnectionHTTPConduitFactory`: the `HTTPConduitFactory` for this client will be set to an implementation always * returning `org.apache.cxf.transport.http.URLConnectionHTTPConduit`. This will use `java.net.HttpURLConnection` as the * underlying HTTP client. diff --git a/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/CxfFixedConfig.java b/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/CxfFixedConfig.java index f1ab5861a..d6fe22a77 100644 --- a/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/CxfFixedConfig.java +++ b/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/CxfFixedConfig.java @@ -71,6 +71,10 @@ public interface CxfFixedConfig { * - `HttpClientHTTPConduitFactory`: the `HTTPConduitFactory` will be set to an implementation always returning * `org.apache.cxf.transport.http.HttpClientHTTPConduit`. This will use `java.net.http.HttpClient` as the underlying HTTP * client. + * + + * *Deprecated since + * xref:release-notes/3.18.0.adoc#_1633_httpclienthttpconduitfactory_value_of_http_conduit_factory_deprecated[3.18.0]* + * +++-+++ use other `HTTPConduitFactory` implementations, preferably `QuarkusCXFDefault`. * - `URLConnectionHTTPConduitFactory`: the `HTTPConduitFactory` will be set to an implementation always returning * `org.apache.cxf.transport.http.URLConnectionHTTPConduit`. This will use `java.net.HttpURLConnection` as the underlying * HTTP client. diff --git a/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/QuarkusHTTPConduitFactory.java b/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/QuarkusHTTPConduitFactory.java index cf0b96194..e0d5ce358 100644 --- a/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/QuarkusHTTPConduitFactory.java +++ b/extensions/core/runtime/src/main/java/io/quarkiverse/cxf/QuarkusHTTPConduitFactory.java @@ -9,11 +9,13 @@ import org.apache.cxf.transport.http.HTTPConduit; import org.apache.cxf.transport.http.HTTPConduitFactory; import org.apache.cxf.transport.http.HTTPTransportFactory; +import org.apache.cxf.transport.http.HttpClientHTTPConduit; import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; import org.apache.cxf.ws.addressing.EndpointReferenceType; import org.jboss.logging.Logger; import io.quarkiverse.cxf.vertx.http.client.HttpClientPool; +import io.quarkus.logging.Log; import io.vertx.core.Vertx; /** @@ -76,6 +78,12 @@ private HTTPConduit configure(HTTPConduitSpec httpConduitImpl, CXFClientInfo cxf EndpointInfo localInfo, EndpointReferenceType target) throws IOException { final HTTPConduit httpConduit = httpConduitImpl.createConduit(httpClientPool, b, localInfo, target); + if (httpConduit instanceof HttpClientHTTPConduit) { + Log.warnf("Usage of %s is deprecated since Quarkus CXF 3.18.0." + + " You may want to review the options quarkus.cxf.http-conduit-factory and/or quarkus.cxf.client.\"%s\".http-conduit-factory", + HttpClientHTTPConduit.class.getName(), + cxfClientInfo.getConfigKey()); + } httpConduitImpl.tlsClientParameters(cxfClientInfo, vertx).ifPresent(httpConduit::setTlsClientParameters); final HTTPClientPolicy policy = new HTTPClientPolicy(); httpConduit.setClient(policy);