[
https://issues.apache.org/jira/browse/CAMEL-27389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Work on CAMEL-27389 started by Claus Ibsen.
-------------------------------------------
> camel-cxf-soap - serve SOAP endpoints on the platform-http server in Camel
> Main and Camel JBang, instead of downloading the Undertow transport
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-27389
> URL: https://issues.apache.org/jira/browse/CAMEL-27389
> Project: Camel
> Issue Type: Improvement
> Components: camel-cxf, camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.24.0
>
>
> A cxf consumer (a SOAP service) needs an HTTP server transport.
> camel-cxf-soap has Jetty and Undertow only in test scope, so the application
> has to bring one. Camel JBang does it with the auto-configure script
> {{dsl/camel-kamelet-main/src/main/resources/auto-configure/camel-cxf-soap.java}}:
> when neither {{cxf-rt-transports-http-jetty}} nor
> {{cxf-rt-transports-http-undertow}} is on the classpath, it binds an
> {{HttpDestinationFactory}} that downloads {{cxf-rt-transports-http-undertow}}
> and starts a separate Undertow server on the port of the address.
> So a SOAP service in Camel Main and Camel JBang runs on its own server and
> port, apart from the platform-http server that REST, platform-http routes,
> health checks and the dev consoles use. It has its own TLS and bind settings,
> and it behaves differently after {{camel export}}: on Spring Boot,
> camel-cxf-soap-starter serves it through the servlet of
> cxf-spring-boot-starter-jaxws under {{cxf.path}} (default {{/services}}), and
> on Quarkus the CXF extension serves it on the Vert.x server of Quarkus under
> {{quarkus.cxf.path}} (default {{/services}}).
> h3. Proposal
> In Camel Main and Camel JBang, a cxf consumer is always served on the
> platform-http server (Vert.x), the same way Quarkus CXF does it on Quarkus.
> No Undertow download and no fallback to a separate server. Spring Boot and
> Quarkus are unchanged: {{camel export}} uses their starter or extension, as
> today.
> * The address of a cxf consumer is a path, such as
> {{cxf:/orders?wsdlURL=...}}. It is served under a base path (default
> {{/services}}, like {{cxf.path}} and {{quarkus.cxf.path}}, so the URL stays
> the same after an export), for example
> {{http://localhost:8080/services/orders}}, and {{?wsdl}} under it. The base
> path is a configuration option; {{camel export}} maps it to {{cxf.path}} or
> {{quarkus.cxf.path}}.
> * An address with a scheme and a host (such as
> {{http://0.0.0.0:9000/orders}}) on a consumer fails at startup with a message
> that says to use a path, since the host and port are those of the
> platform-http server ({{camel.server.*}}). The producer (a SOAP client) is
> unchanged and still takes a full URL.
> * The platform-http server is started when a route has a cxf consumer, as it
> is for a platform-http or REST route.
> * Requests run on a worker thread (a blocking handler), since CXF is blocking.
> * TLS, the port, the bind address and the authentication of platform-http
> apply to SOAP services too.
> h3. How
> Every CXF HTTP destination, Jetty and Undertow included, ends in
> {{AbstractHTTPDestination.invoke(ServletConfig, ServletContext,
> HttpServletRequest, HttpServletResponse)}}, so the bridge wraps the Vert.x
> request and response in servlet objects. Quarkus CXF shows that this works
> ({{io.quarkiverse.cxf.transport}} in quarkiverse/quarkus-cxf):
> {{VertxHttpServletRequest}} and {{VertxHttpServletResponse}} wrap the Vert.x
> {{RoutingContext}}, {{VertxDestinationFactory}} (an {{HTTPTransportFactory}}
> with its own {{DestinationRegistry}}) creates the destinations, and
> {{CxfHandler}} gives each request to CXF's {{ServletController}}.
> For Camel, a lean version can use the hook that the auto-configure script
> uses today: an {{HttpDestinationFactory}} whose destination (a
> {{ServletDestination}}) adds a blocking route for its path on the
> {{VertxPlatformHttpRouter}} of the CamelContext and calls {{invoke(...)}}
> with the wrapped request and response; stopping the consumer removes the
> route. The facade needs the request line, headers, query, the input stream,
> the remote and local address, and on the response the status, headers,
> content type and an output stream. Sessions, dispatchers and most of the
> servlet API are not needed.
> Where it lives: a small module (for example camel-cxf-platform-http) or a
> part of camel-platform-http-main that the auto-configure script of
> camel-cxf-soap adds, in place of the Undertow download. Spring Boot and
> Quarkus exports do not get it.
> To check: large and streamed messages, MTOM attachments, the address that the
> WSDL served at {{?wsdl}} gives (with {{publishedEndpointUrl}} and behind a
> proxy, {{X-Forwarded-*}}), SOAP 1.1 and 1.2, WS-Security on the consumer, and
> two cxf consumers with different paths on the same server.
> h3. Docs
> The camel-cxf docs and the upgrade guide: in Camel JBang and Camel Main, a
> cxf consumer address is a path on the platform-http server, and a full URL
> fails at startup.
> Motivation: the {{soap-source}} Kamelet (apache/camel-kamelets, Preview in
> 4.24) serves a SOAP service from a WSDL. With this change its {{address}}
> becomes a path, and the SOAP service runs on the same server, port and TLS
> settings as the rest of the integration, in Camel JBang and after an export.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)