This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new b7027a75427 CAMEL-21931: Add bridgeEndpoint option to vertx-http producer b7027a75427 is described below commit b7027a754279caf5392e5750a996cfcf3e2890be Author: James Netherton <jamesnether...@gmail.com> AuthorDate: Thu May 8 10:36:38 2025 +0100 CAMEL-21931: Add bridgeEndpoint option to vertx-http producer --- .../camel/catalog/components/vertx-http.json | 51 +++++----- .../vertx/VertxPlatformHttpNoBodyHandlerTest.java | 7 +- .../vertx/http/VertxHttpEndpointConfigurer.java | 6 ++ .../vertx/http/VertxHttpEndpointUriFactory.java | 3 +- .../camel/component/vertx/http/vertx-http.json | 51 +++++----- .../vertx/http/DefaultVertxHttpBinding.java | 13 ++- .../component/vertx/http/VertxHttpBinding.java | 3 +- .../vertx/http/VertxHttpConfiguration.java | 11 +++ .../component/vertx/http/VertxHttpHelper.java | 13 ++- .../vertx/http/VertxHttpBridgeEndpointTest.java | 105 +++++++++++++++++++++ .../vertx/http/VertxHttpCustomBindingTest.java | 3 +- .../dsl/VertxHttpEndpointBuilderFactory.java | 36 +++++++ 12 files changed, 238 insertions(+), 64 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/vertx-http.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/vertx-http.json index 9c4ac033ff6..4f01028b581 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/vertx-http.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/vertx-http.json @@ -56,30 +56,31 @@ }, "properties": { "httpUri": { "index": 0, "kind": "path", "displayName": "Http Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.net.URI", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The HTTP URI to connect to" }, - "connectTimeout": { "index": 1, "kind": "parameter", "displayName": "Connect Timeout", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 60000, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The amount of time in milliseconds until a connection is established. A timeout [...] - "cookieStore": { "index": 2, "kind": "parameter", "displayName": "Cookie Store", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.ext.web.client.spi.CookieStore", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "InMemoryCookieStore", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A custom CookieStore to use when se [...] - "headerFilterStrategy": { "index": 3, "kind": "parameter", "displayName": "Header Filter Strategy", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "VertxHttpHeaderFilterStrategy", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A cu [...] - "httpMethod": { "index": 4, "kind": "parameter", "displayName": "Http Method", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.core.http.HttpMethod", "enum": [ "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "PATCH", "PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK", "MKCALENDAR", "VERSION_CONTROL", "REPORT", "CHECKIN", "CHECKOUT", "UNCHECKOUT", "MKWORKSPACE", "UPDATE", "LABEL", "MERGE", "BAS [...] - "multipartUpload": { "index": 5, "kind": "parameter", "displayName": "Multipart Upload", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Whether to force using multipart\/form-data for easy file uploads. This is [...] - "multipartUploadName": { "index": 6, "kind": "parameter", "displayName": "Multipart Upload Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "data", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The name of the multipart\/form-data when multipartUploa [...] - "okStatusCodeRange": { "index": 7, "kind": "parameter", "displayName": "Ok Status Code Range", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "200-299", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The status codes which are considered a success response [...] - "responsePayloadAsByteArray": { "index": 8, "kind": "parameter", "displayName": "Response Payload As Byte Array", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Whether the response body should be byte or as io. [...] - "sessionManagement": { "index": 9, "kind": "parameter", "displayName": "Session Management", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Enables session management via WebClientSession. By default the client [...] - "throwExceptionOnFailure": { "index": 10, "kind": "parameter", "displayName": "Throw Exception On Failure", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Disable throwing HttpOperationFailedException in case of [...] - "timeout": { "index": 11, "kind": "parameter", "displayName": "Timeout", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": -1, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The amount of time in milliseconds after which if the request does not return any data within th [...] - "transferException": { "index": 12, "kind": "parameter", "displayName": "Transfer Exception", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "If enabled and an Exchange failed processing on the consumer side, an [...] - "useCompression": { "index": 13, "kind": "parameter", "displayName": "Use Compression", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Set whether compression is enabled to handled compressed (E.g gzipped) resp [...] - "vertxHttpBinding": { "index": 14, "kind": "parameter", "displayName": "Vertx Http Binding", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.vertx.http.VertxHttpBinding", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A custom VertxHttpBinding which can control how [...] - "webClientOptions": { "index": 15, "kind": "parameter", "displayName": "Web Client Options", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.ext.web.client.WebClientOptions", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Sets customized options for configuring the Vert.x WebClient" }, - "lazyStartProducer": { "index": 16, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] - "proxyHost": { "index": 17, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server host address" }, - "proxyPassword": { "index": 18, "kind": "parameter", "displayName": "Proxy Password", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server password if authentication is required" }, - "proxyPort": { "index": 19, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server port" }, - "proxyType": { "index": 20, "kind": "parameter", "displayName": "Proxy Type", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "io.vertx.core.net.ProxyType", "enum": [ "HTTP", "SOCKS4", "SOCKS5" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server type" }, - "proxyUsername": { "index": 21, "kind": "parameter", "displayName": "Proxy Username", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server username if authentication is required" }, - "basicAuthPassword": { "index": 22, "kind": "parameter", "displayName": "Basic Auth Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The password to use for basic authentication" }, - "basicAuthUsername": { "index": 23, "kind": "parameter", "displayName": "Basic Auth Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The user name to use for basic authentication" }, - "bearerToken": { "index": 24, "kind": "parameter", "displayName": "Bearer Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The bearer token to use for bearer token authentication" }, - "sslContextParameters": { "index": 25, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParam [...] + "bridgeEndpoint": { "index": 1, "kind": "parameter", "displayName": "Bridge Endpoint", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "If the option is true, the Exchange.HTTP_URI header will be ignored and the [...] + "connectTimeout": { "index": 2, "kind": "parameter", "displayName": "Connect Timeout", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 60000, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The amount of time in milliseconds until a connection is established. A timeout [...] + "cookieStore": { "index": 3, "kind": "parameter", "displayName": "Cookie Store", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.ext.web.client.spi.CookieStore", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "InMemoryCookieStore", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A custom CookieStore to use when se [...] + "headerFilterStrategy": { "index": 4, "kind": "parameter", "displayName": "Header Filter Strategy", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "VertxHttpHeaderFilterStrategy", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A cu [...] + "httpMethod": { "index": 5, "kind": "parameter", "displayName": "Http Method", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.core.http.HttpMethod", "enum": [ "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "PATCH", "PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK", "MKCALENDAR", "VERSION_CONTROL", "REPORT", "CHECKIN", "CHECKOUT", "UNCHECKOUT", "MKWORKSPACE", "UPDATE", "LABEL", "MERGE", "BAS [...] + "multipartUpload": { "index": 6, "kind": "parameter", "displayName": "Multipart Upload", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Whether to force using multipart\/form-data for easy file uploads. This is [...] + "multipartUploadName": { "index": 7, "kind": "parameter", "displayName": "Multipart Upload Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "data", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The name of the multipart\/form-data when multipartUploa [...] + "okStatusCodeRange": { "index": 8, "kind": "parameter", "displayName": "Ok Status Code Range", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "200-299", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The status codes which are considered a success response [...] + "responsePayloadAsByteArray": { "index": 9, "kind": "parameter", "displayName": "Response Payload As Byte Array", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Whether the response body should be byte or as io. [...] + "sessionManagement": { "index": 10, "kind": "parameter", "displayName": "Session Management", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Enables session management via WebClientSession. By default the clien [...] + "throwExceptionOnFailure": { "index": 11, "kind": "parameter", "displayName": "Throw Exception On Failure", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Disable throwing HttpOperationFailedException in case of [...] + "timeout": { "index": 12, "kind": "parameter", "displayName": "Timeout", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": -1, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The amount of time in milliseconds after which if the request does not return any data within th [...] + "transferException": { "index": 13, "kind": "parameter", "displayName": "Transfer Exception", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "If enabled and an Exchange failed processing on the consumer side, an [...] + "useCompression": { "index": 14, "kind": "parameter", "displayName": "Use Compression", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Set whether compression is enabled to handled compressed (E.g gzipped) resp [...] + "vertxHttpBinding": { "index": 15, "kind": "parameter", "displayName": "Vertx Http Binding", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.vertx.http.VertxHttpBinding", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A custom VertxHttpBinding which can control how [...] + "webClientOptions": { "index": 16, "kind": "parameter", "displayName": "Web Client Options", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.ext.web.client.WebClientOptions", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Sets customized options for configuring the Vert.x WebClient" }, + "lazyStartProducer": { "index": 17, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] + "proxyHost": { "index": 18, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server host address" }, + "proxyPassword": { "index": 19, "kind": "parameter", "displayName": "Proxy Password", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server password if authentication is required" }, + "proxyPort": { "index": 20, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server port" }, + "proxyType": { "index": 21, "kind": "parameter", "displayName": "Proxy Type", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "io.vertx.core.net.ProxyType", "enum": [ "HTTP", "SOCKS4", "SOCKS5" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server type" }, + "proxyUsername": { "index": 22, "kind": "parameter", "displayName": "Proxy Username", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server username if authentication is required" }, + "basicAuthPassword": { "index": 23, "kind": "parameter", "displayName": "Basic Auth Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The password to use for basic authentication" }, + "basicAuthUsername": { "index": 24, "kind": "parameter", "displayName": "Basic Auth Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The user name to use for basic authentication" }, + "bearerToken": { "index": 25, "kind": "parameter", "displayName": "Bearer Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The bearer token to use for bearer token authentication" }, + "sslContextParameters": { "index": 26, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParam [...] } } diff --git a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpNoBodyHandlerTest.java b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpNoBodyHandlerTest.java index 5c3a9146e04..48b23bd37d1 100644 --- a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpNoBodyHandlerTest.java +++ b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpNoBodyHandlerTest.java @@ -18,6 +18,7 @@ package org.apache.camel.component.platform.http.vertx; import com.github.tomakehurst.wiremock.WireMockServer; import org.apache.camel.CamelContext; +import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.AvailablePortFinder; import org.junit.jupiter.api.AfterEach; @@ -63,11 +64,11 @@ public class VertxPlatformHttpNoBodyHandlerTest { @Override public void configure() { from("platform-http:/camel?matchOnUriPrefix=true&useBodyHandler=false") - .removeHeader("CamelHttpUri") .setHeader("OrgCamelHttpUri", simple(mockUrl + "${header.CamelHttpPath}")) - .setHeader("CamelHttpPath", simple("")) + // matchOnUriPrefix is true so we need to strip the path header to get the correct target URL to bridge to + .removeHeader(Exchange.HTTP_PATH) .toD("${bean:" + PathCreator.class.getName() - + "?method=createNewUri(${header.OrgCamelHttpUri})}?bridgeEndpoint=true"); + + "?method=createNewUri(${header.OrgCamelHttpUri}?bridgeEndpoint=true)}"); } }); diff --git a/components/camel-vertx/camel-vertx-http/src/generated/java/org/apache/camel/component/vertx/http/VertxHttpEndpointConfigurer.java b/components/camel-vertx/camel-vertx-http/src/generated/java/org/apache/camel/component/vertx/http/VertxHttpEndpointConfigurer.java index 10fff470550..3bb1456b683 100644 --- a/components/camel-vertx/camel-vertx-http/src/generated/java/org/apache/camel/component/vertx/http/VertxHttpEndpointConfigurer.java +++ b/components/camel-vertx/camel-vertx-http/src/generated/java/org/apache/camel/component/vertx/http/VertxHttpEndpointConfigurer.java @@ -29,6 +29,8 @@ public class VertxHttpEndpointConfigurer extends PropertyConfigurerSupport imple case "basicAuthUsername": target.getConfiguration().setBasicAuthUsername(property(camelContext, java.lang.String.class, value)); return true; case "bearertoken": case "bearerToken": target.getConfiguration().setBearerToken(property(camelContext, java.lang.String.class, value)); return true; + case "bridgeendpoint": + case "bridgeEndpoint": target.getConfiguration().setBridgeEndpoint(property(camelContext, boolean.class, value)); return true; case "connecttimeout": case "connectTimeout": target.getConfiguration().setConnectTimeout(property(camelContext, int.class, value)); return true; case "cookiestore": @@ -85,6 +87,8 @@ public class VertxHttpEndpointConfigurer extends PropertyConfigurerSupport imple case "basicAuthUsername": return java.lang.String.class; case "bearertoken": case "bearerToken": return java.lang.String.class; + case "bridgeendpoint": + case "bridgeEndpoint": return boolean.class; case "connecttimeout": case "connectTimeout": return int.class; case "cookiestore": @@ -142,6 +146,8 @@ public class VertxHttpEndpointConfigurer extends PropertyConfigurerSupport imple case "basicAuthUsername": return target.getConfiguration().getBasicAuthUsername(); case "bearertoken": case "bearerToken": return target.getConfiguration().getBearerToken(); + case "bridgeendpoint": + case "bridgeEndpoint": return target.getConfiguration().isBridgeEndpoint(); case "connecttimeout": case "connectTimeout": return target.getConfiguration().getConnectTimeout(); case "cookiestore": diff --git a/components/camel-vertx/camel-vertx-http/src/generated/java/org/apache/camel/component/vertx/http/VertxHttpEndpointUriFactory.java b/components/camel-vertx/camel-vertx-http/src/generated/java/org/apache/camel/component/vertx/http/VertxHttpEndpointUriFactory.java index 6c1044be58f..0752159d2c9 100644 --- a/components/camel-vertx/camel-vertx-http/src/generated/java/org/apache/camel/component/vertx/http/VertxHttpEndpointUriFactory.java +++ b/components/camel-vertx/camel-vertx-http/src/generated/java/org/apache/camel/component/vertx/http/VertxHttpEndpointUriFactory.java @@ -23,10 +23,11 @@ public class VertxHttpEndpointUriFactory extends org.apache.camel.support.compon private static final Set<String> SECRET_PROPERTY_NAMES; private static final Set<String> MULTI_VALUE_PREFIXES; static { - Set<String> props = new HashSet<>(26); + Set<String> props = new HashSet<>(27); props.add("basicAuthPassword"); props.add("basicAuthUsername"); props.add("bearerToken"); + props.add("bridgeEndpoint"); props.add("connectTimeout"); props.add("cookieStore"); props.add("headerFilterStrategy"); diff --git a/components/camel-vertx/camel-vertx-http/src/generated/resources/META-INF/org/apache/camel/component/vertx/http/vertx-http.json b/components/camel-vertx/camel-vertx-http/src/generated/resources/META-INF/org/apache/camel/component/vertx/http/vertx-http.json index 9c4ac033ff6..4f01028b581 100644 --- a/components/camel-vertx/camel-vertx-http/src/generated/resources/META-INF/org/apache/camel/component/vertx/http/vertx-http.json +++ b/components/camel-vertx/camel-vertx-http/src/generated/resources/META-INF/org/apache/camel/component/vertx/http/vertx-http.json @@ -56,30 +56,31 @@ }, "properties": { "httpUri": { "index": 0, "kind": "path", "displayName": "Http Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.net.URI", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The HTTP URI to connect to" }, - "connectTimeout": { "index": 1, "kind": "parameter", "displayName": "Connect Timeout", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 60000, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The amount of time in milliseconds until a connection is established. A timeout [...] - "cookieStore": { "index": 2, "kind": "parameter", "displayName": "Cookie Store", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.ext.web.client.spi.CookieStore", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "InMemoryCookieStore", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A custom CookieStore to use when se [...] - "headerFilterStrategy": { "index": 3, "kind": "parameter", "displayName": "Header Filter Strategy", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "VertxHttpHeaderFilterStrategy", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A cu [...] - "httpMethod": { "index": 4, "kind": "parameter", "displayName": "Http Method", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.core.http.HttpMethod", "enum": [ "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "PATCH", "PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK", "MKCALENDAR", "VERSION_CONTROL", "REPORT", "CHECKIN", "CHECKOUT", "UNCHECKOUT", "MKWORKSPACE", "UPDATE", "LABEL", "MERGE", "BAS [...] - "multipartUpload": { "index": 5, "kind": "parameter", "displayName": "Multipart Upload", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Whether to force using multipart\/form-data for easy file uploads. This is [...] - "multipartUploadName": { "index": 6, "kind": "parameter", "displayName": "Multipart Upload Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "data", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The name of the multipart\/form-data when multipartUploa [...] - "okStatusCodeRange": { "index": 7, "kind": "parameter", "displayName": "Ok Status Code Range", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "200-299", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The status codes which are considered a success response [...] - "responsePayloadAsByteArray": { "index": 8, "kind": "parameter", "displayName": "Response Payload As Byte Array", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Whether the response body should be byte or as io. [...] - "sessionManagement": { "index": 9, "kind": "parameter", "displayName": "Session Management", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Enables session management via WebClientSession. By default the client [...] - "throwExceptionOnFailure": { "index": 10, "kind": "parameter", "displayName": "Throw Exception On Failure", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Disable throwing HttpOperationFailedException in case of [...] - "timeout": { "index": 11, "kind": "parameter", "displayName": "Timeout", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": -1, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The amount of time in milliseconds after which if the request does not return any data within th [...] - "transferException": { "index": 12, "kind": "parameter", "displayName": "Transfer Exception", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "If enabled and an Exchange failed processing on the consumer side, an [...] - "useCompression": { "index": 13, "kind": "parameter", "displayName": "Use Compression", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Set whether compression is enabled to handled compressed (E.g gzipped) resp [...] - "vertxHttpBinding": { "index": 14, "kind": "parameter", "displayName": "Vertx Http Binding", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.vertx.http.VertxHttpBinding", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A custom VertxHttpBinding which can control how [...] - "webClientOptions": { "index": 15, "kind": "parameter", "displayName": "Web Client Options", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.ext.web.client.WebClientOptions", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Sets customized options for configuring the Vert.x WebClient" }, - "lazyStartProducer": { "index": 16, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] - "proxyHost": { "index": 17, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server host address" }, - "proxyPassword": { "index": 18, "kind": "parameter", "displayName": "Proxy Password", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server password if authentication is required" }, - "proxyPort": { "index": 19, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server port" }, - "proxyType": { "index": 20, "kind": "parameter", "displayName": "Proxy Type", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "io.vertx.core.net.ProxyType", "enum": [ "HTTP", "SOCKS4", "SOCKS5" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server type" }, - "proxyUsername": { "index": 21, "kind": "parameter", "displayName": "Proxy Username", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server username if authentication is required" }, - "basicAuthPassword": { "index": 22, "kind": "parameter", "displayName": "Basic Auth Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The password to use for basic authentication" }, - "basicAuthUsername": { "index": 23, "kind": "parameter", "displayName": "Basic Auth Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The user name to use for basic authentication" }, - "bearerToken": { "index": 24, "kind": "parameter", "displayName": "Bearer Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The bearer token to use for bearer token authentication" }, - "sslContextParameters": { "index": 25, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParam [...] + "bridgeEndpoint": { "index": 1, "kind": "parameter", "displayName": "Bridge Endpoint", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "If the option is true, the Exchange.HTTP_URI header will be ignored and the [...] + "connectTimeout": { "index": 2, "kind": "parameter", "displayName": "Connect Timeout", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 60000, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The amount of time in milliseconds until a connection is established. A timeout [...] + "cookieStore": { "index": 3, "kind": "parameter", "displayName": "Cookie Store", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.ext.web.client.spi.CookieStore", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "InMemoryCookieStore", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A custom CookieStore to use when se [...] + "headerFilterStrategy": { "index": 4, "kind": "parameter", "displayName": "Header Filter Strategy", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "VertxHttpHeaderFilterStrategy", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A cu [...] + "httpMethod": { "index": 5, "kind": "parameter", "displayName": "Http Method", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.core.http.HttpMethod", "enum": [ "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "PATCH", "PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK", "MKCALENDAR", "VERSION_CONTROL", "REPORT", "CHECKIN", "CHECKOUT", "UNCHECKOUT", "MKWORKSPACE", "UPDATE", "LABEL", "MERGE", "BAS [...] + "multipartUpload": { "index": 6, "kind": "parameter", "displayName": "Multipart Upload", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Whether to force using multipart\/form-data for easy file uploads. This is [...] + "multipartUploadName": { "index": 7, "kind": "parameter", "displayName": "Multipart Upload Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "data", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The name of the multipart\/form-data when multipartUploa [...] + "okStatusCodeRange": { "index": 8, "kind": "parameter", "displayName": "Ok Status Code Range", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "200-299", "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The status codes which are considered a success response [...] + "responsePayloadAsByteArray": { "index": 9, "kind": "parameter", "displayName": "Response Payload As Byte Array", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Whether the response body should be byte or as io. [...] + "sessionManagement": { "index": 10, "kind": "parameter", "displayName": "Session Management", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Enables session management via WebClientSession. By default the clien [...] + "throwExceptionOnFailure": { "index": 11, "kind": "parameter", "displayName": "Throw Exception On Failure", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Disable throwing HttpOperationFailedException in case of [...] + "timeout": { "index": 12, "kind": "parameter", "displayName": "Timeout", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": -1, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The amount of time in milliseconds after which if the request does not return any data within th [...] + "transferException": { "index": 13, "kind": "parameter", "displayName": "Transfer Exception", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "If enabled and an Exchange failed processing on the consumer side, an [...] + "useCompression": { "index": 14, "kind": "parameter", "displayName": "Use Compression", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Set whether compression is enabled to handled compressed (E.g gzipped) resp [...] + "vertxHttpBinding": { "index": 15, "kind": "parameter", "displayName": "Vertx Http Binding", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.vertx.http.VertxHttpBinding", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "A custom VertxHttpBinding which can control how [...] + "webClientOptions": { "index": 16, "kind": "parameter", "displayName": "Web Client Options", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.vertx.ext.web.client.WebClientOptions", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "Sets customized options for configuring the Vert.x WebClient" }, + "lazyStartProducer": { "index": 17, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] + "proxyHost": { "index": 18, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server host address" }, + "proxyPassword": { "index": 19, "kind": "parameter", "displayName": "Proxy Password", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server password if authentication is required" }, + "proxyPort": { "index": 20, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server port" }, + "proxyType": { "index": 21, "kind": "parameter", "displayName": "Proxy Type", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "io.vertx.core.net.ProxyType", "enum": [ "HTTP", "SOCKS4", "SOCKS5" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server type" }, + "proxyUsername": { "index": 22, "kind": "parameter", "displayName": "Proxy Username", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The proxy server username if authentication is required" }, + "basicAuthPassword": { "index": 23, "kind": "parameter", "displayName": "Basic Auth Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The password to use for basic authentication" }, + "basicAuthUsername": { "index": 24, "kind": "parameter", "displayName": "Basic Auth Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The user name to use for basic authentication" }, + "bearerToken": { "index": 25, "kind": "parameter", "displayName": "Bearer Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "The bearer token to use for bearer token authentication" }, + "sslContextParameters": { "index": 26, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.vertx.http.VertxHttpConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParam [...] } } diff --git a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/DefaultVertxHttpBinding.java b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/DefaultVertxHttpBinding.java index fba375ee805..020afd8c9de 100644 --- a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/DefaultVertxHttpBinding.java +++ b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/DefaultVertxHttpBinding.java @@ -54,7 +54,7 @@ public class DefaultVertxHttpBinding implements VertxHttpBinding { Message message = exchange.getMessage(); // Resolve query string from the HTTP_QUERY header or default to those provided on the endpoint HTTP URI - String queryString = VertxHttpHelper.resolveQueryString(exchange); + String queryString = VertxHttpHelper.resolveQueryString(exchange, endpoint); Map<String, Object> queryParams = null; if (ObjectHelper.isEmpty(queryString)) { // use default query string from endpoint configuration @@ -109,7 +109,7 @@ public class DefaultVertxHttpBinding implements VertxHttpBinding { request.bearerTokenAuthentication(configuration.getBearerToken()); } - populateRequestHeaders(exchange, request, configuration.getHeaderFilterStrategy()); + populateRequestHeaders(endpoint, exchange, request, configuration.getHeaderFilterStrategy()); if (configuration.getTimeout() > -1) { request.timeout(configuration.getTimeout()); @@ -119,7 +119,8 @@ public class DefaultVertxHttpBinding implements VertxHttpBinding { } @Override - public void populateRequestHeaders(Exchange exchange, HttpRequest<Buffer> request, HeaderFilterStrategy strategy) { + public void populateRequestHeaders( + VertxHttpEndpoint endpoint, Exchange exchange, HttpRequest<Buffer> request, HeaderFilterStrategy strategy) { // optimize to use add on MultiMap as putHeader on request does a remove/add MultiMap headers = request.headers(); @@ -135,6 +136,12 @@ public class DefaultVertxHttpBinding implements VertxHttpBinding { for (Map.Entry<String, Object> entry : exchange.getMessage().getHeaders().entrySet()) { String key = entry.getKey(); Object headerValue = entry.getValue(); + + if (endpoint.getConfiguration().isBridgeEndpoint() && request.queryParams().contains(key)) { + // Avoid duplicating headers when bridgeEndpoint and query params contains the same header keys + continue; + } + if (!strategy.applyFilterToCamelHeaders(key, headerValue, exchange)) { String str = tc.convertTo(String.class, headerValue); headers.set(key, str); diff --git a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpBinding.java b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpBinding.java index 96072f279e7..7b9dbbfef13 100644 --- a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpBinding.java +++ b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpBinding.java @@ -34,7 +34,8 @@ public interface VertxHttpBinding { /** * Populates request headers on the {@link HttpRequest} using the supplied {@link HeaderFilterStrategy} */ - void populateRequestHeaders(Exchange exchange, HttpRequest<Buffer> request, HeaderFilterStrategy strategy); + void populateRequestHeaders( + VertxHttpEndpoint endpoint, Exchange exchange, HttpRequest<Buffer> request, HeaderFilterStrategy strategy); /** * Handles the {@link HttpResponse} returned from the HTTP endpoint invocation diff --git a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpConfiguration.java b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpConfiguration.java index 08d8f93ce3c..297186faae0 100644 --- a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpConfiguration.java +++ b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpConfiguration.java @@ -87,6 +87,9 @@ public class VertxHttpConfiguration { @UriParam(label = "producer", defaultValue = "data", description = "The name of the multipart/form-data when multipartUpload is enabled.") private String multipartUploadName = "data"; + @UriParam(label = "producer", + description = "If the option is true, the Exchange.HTTP_URI header will be ignored and the endpoint URI will be used for the HTTP request. You may also set option throwExceptionOnFailure to false to return the fault response back to the client.") + private boolean bridgeEndpoint; /** * The HTTP URI to connect to @@ -377,4 +380,12 @@ public class VertxHttpConfiguration { public void setMultipartUploadName(String multipartUploadName) { this.multipartUploadName = multipartUploadName; } + + public boolean isBridgeEndpoint() { + return bridgeEndpoint; + } + + public void setBridgeEndpoint(boolean bridgeEndpoint) { + this.bridgeEndpoint = bridgeEndpoint; + } } diff --git a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpHelper.java b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpHelper.java index d6ee8cad4a2..c377f3125bb 100644 --- a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpHelper.java +++ b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpHelper.java @@ -40,17 +40,20 @@ public final class VertxHttpHelper { /** * Resolves a HTTP URI query string from the given exchange message headers */ - public static String resolveQueryString(Exchange exchange) throws URISyntaxException { + public static String resolveQueryString(Exchange exchange, VertxHttpEndpoint endpoint) throws URISyntaxException { Message message = exchange.getMessage(); String queryString = (String) message.removeHeader(Exchange.REST_HTTP_QUERY); if (ObjectHelper.isEmpty(queryString)) { queryString = message.getHeader(VertxHttpConstants.HTTP_QUERY, String.class); } - String uriString = message.getHeader(VertxHttpConstants.HTTP_URI, String.class); - uriString = exchange.getContext().resolvePropertyPlaceholders(uriString); + String uriString = null; + if (!endpoint.getConfiguration().isBridgeEndpoint()) { + uriString = message.getHeader(VertxHttpConstants.HTTP_URI, String.class); + uriString = exchange.getContext().resolvePropertyPlaceholders(uriString); + } - if (uriString != null) { + if (ObjectHelper.isNotEmpty(uriString)) { uriString = UnsafeUriCharactersEncoder.encodeHttpURI(uriString); URI uri = new URI(uriString); queryString = uri.getQuery(); @@ -66,7 +69,7 @@ public final class VertxHttpHelper { Message message = exchange.getMessage(); String uri = (String) message.removeHeader(Exchange.REST_HTTP_URI); - if (ObjectHelper.isEmpty(uri)) { + if (ObjectHelper.isEmpty(uri) && !endpoint.getConfiguration().isBridgeEndpoint()) { uri = message.getHeader(VertxHttpConstants.HTTP_URI, String.class); } diff --git a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpBridgeEndpointTest.java b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpBridgeEndpointTest.java new file mode 100644 index 00000000000..7503bd49569 --- /dev/null +++ b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpBridgeEndpointTest.java @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.vertx.http; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.camel.Exchange; +import org.apache.camel.RoutesBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.AvailablePortFinder; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; + +class VertxHttpBridgeEndpointTest extends VertxHttpTestSupport { + private static final int PORT = AvailablePortFinder.getNextAvailable(); + + @Test + void bridgeEndpointWithQueryStringDoesNotDuplicateHeaders() throws Exception { + MockEndpoint mockEndpoint = getMockEndpoint("mock:result"); + mockEndpoint.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); + + Map<String, String> queryParams = Map.of("q1", "1", "q2", "2", "q3", "3"); + String queryString = queryParams.entrySet() + .stream() + .map(entry -> entry.getKey() + "=" + entry.getValue()) + .collect(Collectors.joining("&")); + + template.sendBody(getProducerUri() + "/upstream?" + queryString, null); + + mockEndpoint.assertIsSatisfied(); + + List<Exchange> exchanges = mockEndpoint.getExchanges(); + Exchange exchange = exchanges.get(0); + + // Verify query params were passed on when bridging and did not cause duplicate headers + Map<String, Object> headers = exchange.getMessage().getHeaders(); + queryParams.keySet().forEach(key -> { + Object headerValue = headers.get(key); + assertInstanceOf(String.class, headerValue); + assertEquals(queryParams.get(key), headerValue); + }); + } + + @Test + void bridgeEndpointWhenMatchOnUriPrefixSetsHttpPath() throws Exception { + MockEndpoint mockEndpoint = getMockEndpoint("mock:result"); + mockEndpoint.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); + + template.sendBody(getProducerUri() + "/upstream/prefix/test", null); + + mockEndpoint.assertIsSatisfied(); + } + + @Test + void bridgeEndpointWithBody() throws Exception { + String body = "Hello World"; + + MockEndpoint mockEndpoint = getMockEndpoint("mock:result"); + mockEndpoint.expectedHeaderReceived(Exchange.HTTP_METHOD, "POST"); + mockEndpoint.expectedBodiesReceived(body); + + template.sendBody(getProducerUri() + "/upstream", body); + + mockEndpoint.assertIsSatisfied(); + } + + @Override + protected RoutesBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + from(getTestServerUri() + "/upstream") + .toF("vertx-http:http://localhost:%d/downstream?bridgeEndpoint=true", PORT); + + from(getTestServerUri() + "/upstream/prefix?matchOnUriPrefix=true") + .toF("vertx-http:http://localhost:%d/downstream?bridgeEndpoint=true", PORT); + + fromF("undertow:http://localhost:%d/downstream", PORT) + .to("mock:result"); + + fromF("undertow:http://localhost:%d/downstream/test", PORT) + .to("mock:result"); + } + }; + } +} diff --git a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpCustomBindingTest.java b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpCustomBindingTest.java index 8fc483b48a6..a98bc1a84db 100644 --- a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpCustomBindingTest.java +++ b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpCustomBindingTest.java @@ -54,7 +54,8 @@ public class VertxHttpCustomBindingTest extends VertxHttpTestSupport { } @Override - public void populateRequestHeaders(Exchange exchange, HttpRequest<Buffer> request, HeaderFilterStrategy strategy) { + public void populateRequestHeaders( + VertxHttpEndpoint endpoint, Exchange exchange, HttpRequest<Buffer> request, HeaderFilterStrategy strategy) { // Noop } diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/VertxHttpEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/VertxHttpEndpointBuilderFactory.java index 4e7c1eff20c..47e6290e7d2 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/VertxHttpEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/VertxHttpEndpointBuilderFactory.java @@ -44,6 +44,42 @@ public interface VertxHttpEndpointBuilderFactory { return (AdvancedVertxHttpEndpointBuilder) this; } + /** + * If the option is true, the Exchange.HTTP_URI header will be ignored + * and the endpoint URI will be used for the HTTP request. You may also + * set option throwExceptionOnFailure to false to return the fault + * response back to the client. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param bridgeEndpoint the value to set + * @return the dsl builder + */ + default VertxHttpEndpointBuilder bridgeEndpoint(boolean bridgeEndpoint) { + doSetProperty("bridgeEndpoint", bridgeEndpoint); + return this; + } + /** + * If the option is true, the Exchange.HTTP_URI header will be ignored + * and the endpoint URI will be used for the HTTP request. You may also + * set option throwExceptionOnFailure to false to return the fault + * response back to the client. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param bridgeEndpoint the value to set + * @return the dsl builder + */ + default VertxHttpEndpointBuilder bridgeEndpoint(String bridgeEndpoint) { + doSetProperty("bridgeEndpoint", bridgeEndpoint); + return this; + } /** * The amount of time in milliseconds until a connection is established. * A timeout value of zero is interpreted as an infinite timeout.