This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 265efd2 CAMEL-15837: Added an option to enable connection protocol fine tracing in camel-nats 265efd2 is described below commit 265efd2fe679502896fa55d3721cab8ef13c1536 Author: aldettinger <aldettin...@gmail.com> AuthorDate: Mon Nov 9 19:28:52 2020 +0100 CAMEL-15837: Added an option to enable connection protocol fine tracing in camel-nats --- .../apache/camel/catalog/docs/nats-component.adoc | 3 +- .../component/nats/NatsEndpointConfigurer.java | 6 ++ .../component/nats/NatsEndpointUriFactory.java | 3 +- .../org/apache/camel/component/nats/nats.json | 1 + .../camel-nats/src/main/docs/nats-component.adoc | 3 +- .../camel/component/nats/NatsConfiguration.java | 17 +++++ .../endpoint/dsl/NatsEndpointBuilderFactory.java | 84 ++++++++++++++++++++++ .../modules/ROOT/pages/nats-component.adoc | 3 +- 8 files changed, 116 insertions(+), 4 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/nats-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/nats-component.adoc index c530af3..f862e5c 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/nats-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/nats-component.adoc @@ -79,7 +79,7 @@ with the following path and query parameters: |=== -=== Query Parameters (28 parameters): +=== Query Parameters (29 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -111,6 +111,7 @@ with the following path and query parameters: | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *connection* (advanced) | Reference an already instantiated connection to Nats server | | Connection | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean +| *traceConnection* (advanced) | Whether or not connection trace messages should be printed to standard out for fine grained debugging of connection issues. | false | boolean | *secure* (security) | Set secure option indicating TLS is required | false | boolean | *sslContextParameters* (security) | To configure security using SSLContextParameters | | SSLContextParameters |=== diff --git a/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointConfigurer.java b/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointConfigurer.java index 266d10d..a1a04ce 100644 --- a/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointConfigurer.java +++ b/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointConfigurer.java @@ -69,6 +69,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements case "sslcontextparameters": case "sslContextParameters": target.getConfiguration().setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true; case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true; + case "traceconnection": + case "traceConnection": target.getConfiguration().setTraceConnection(property(camelContext, boolean.class, value)); return true; case "verbose": target.getConfiguration().setVerbose(property(camelContext, boolean.class, value)); return true; default: return false; } @@ -125,6 +127,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements case "sslcontextparameters": case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class; case "synchronous": return boolean.class; + case "traceconnection": + case "traceConnection": return boolean.class; case "verbose": return boolean.class; default: return null; } @@ -182,6 +186,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements case "sslcontextparameters": case "sslContextParameters": return target.getConfiguration().getSslContextParameters(); case "synchronous": return target.isSynchronous(); + case "traceconnection": + case "traceConnection": return target.getConfiguration().isTraceConnection(); case "verbose": return target.getConfiguration().isVerbose(); default: return null; } diff --git a/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointUriFactory.java b/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointUriFactory.java index 7559095..36bd226 100644 --- a/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointUriFactory.java +++ b/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointUriFactory.java @@ -20,7 +20,7 @@ public class NatsEndpointUriFactory extends org.apache.camel.support.component.E private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { - Set<String> props = new HashSet<>(29); + Set<String> props = new HashSet<>(30); props.add("basicPropertyBinding"); props.add("replySubject"); props.add("synchronous"); @@ -33,6 +33,7 @@ public class NatsEndpointUriFactory extends org.apache.camel.support.component.E props.add("bridgeErrorHandler"); props.add("pedantic"); props.add("connection"); + props.add("traceConnection"); props.add("connectionTimeout"); props.add("reconnectTimeWait"); props.add("pingInterval"); diff --git a/components/camel-nats/src/generated/resources/org/apache/camel/component/nats/nats.json b/components/camel-nats/src/generated/resources/org/apache/camel/component/nats/nats.json index 7a85f51..5616ddc 100644 --- a/components/camel-nats/src/generated/resources/org/apache/camel/component/nats/nats.json +++ b/components/camel-nats/src/generated/resources/org/apache/camel/component/nats/nats.json @@ -57,6 +57,7 @@ "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" }, "connection": { "kind": "parameter", "displayName": "Connection", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "io.nats.client.Connection", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Reference an already instantiated connection to Nats server" }, "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." }, + "traceConnection": { "kind": "parameter", "displayName": "Trace Connection", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Whether or not connection trace messages should be printed to standard out for fine grained debugging of connection i [...] "secure": { "kind": "parameter", "displayName": "Secure", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Set secure option indicating TLS is required" }, "sslContextParameters": { "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters" } } diff --git a/components/camel-nats/src/main/docs/nats-component.adoc b/components/camel-nats/src/main/docs/nats-component.adoc index c530af3..f862e5c 100644 --- a/components/camel-nats/src/main/docs/nats-component.adoc +++ b/components/camel-nats/src/main/docs/nats-component.adoc @@ -79,7 +79,7 @@ with the following path and query parameters: |=== -=== Query Parameters (28 parameters): +=== Query Parameters (29 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -111,6 +111,7 @@ with the following path and query parameters: | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *connection* (advanced) | Reference an already instantiated connection to Nats server | | Connection | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean +| *traceConnection* (advanced) | Whether or not connection trace messages should be printed to standard out for fine grained debugging of connection issues. | false | boolean | *secure* (security) | Set secure option indicating TLS is required | false | boolean | *sslContextParameters* (security) | To configure security using SSLContextParameters | | SSLContextParameters |=== diff --git a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java index 785242d..2e6553a 100644 --- a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java +++ b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java @@ -79,6 +79,8 @@ public class NatsConfiguration { private boolean secure; @UriParam(label = "security") private SSLContextParameters sslContextParameters; + @UriParam(label = "advanced") + private boolean traceConnection; /** * URLs to one or more NAT servers. Use comma to separate URLs when specifying multiple servers. @@ -340,6 +342,9 @@ public class NatsConfiguration { if (isVerbose()) { builder.verbose(); } + if (isTraceConnection()) { + builder.traceConnection(); + } if (isPedantic()) { builder.pedantic(); } @@ -382,4 +387,16 @@ public class NatsConfiguration { } return servers.toString(); } + + /** + * Whether or not connection trace messages should be printed to standard out for fine grained debugging of + * connection issues. + */ + public boolean isTraceConnection() { + return traceConnection; + } + + public void setTraceConnection(boolean traceConnection) { + this.traceConnection = traceConnection; + } } diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NatsEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NatsEndpointBuilderFactory.java index e587689..34b8f83 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NatsEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NatsEndpointBuilderFactory.java @@ -697,6 +697,34 @@ public interface NatsEndpointBuilderFactory { doSetProperty("synchronous", synchronous); return this; } + /** + * Whether or not connection trace messages should be printed to + * standard out for fine grained debugging of connection issues. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: advanced + */ + default AdvancedNatsEndpointConsumerBuilder traceConnection( + boolean traceConnection) { + doSetProperty("traceConnection", traceConnection); + return this; + } + /** + * Whether or not connection trace messages should be printed to + * standard out for fine grained debugging of connection issues. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: advanced + */ + default AdvancedNatsEndpointConsumerBuilder traceConnection( + String traceConnection) { + doSetProperty("traceConnection", traceConnection); + return this; + } } /** @@ -1249,6 +1277,34 @@ public interface NatsEndpointBuilderFactory { doSetProperty("synchronous", synchronous); return this; } + /** + * Whether or not connection trace messages should be printed to + * standard out for fine grained debugging of connection issues. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: advanced + */ + default AdvancedNatsEndpointProducerBuilder traceConnection( + boolean traceConnection) { + doSetProperty("traceConnection", traceConnection); + return this; + } + /** + * Whether or not connection trace messages should be printed to + * standard out for fine grained debugging of connection issues. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: advanced + */ + default AdvancedNatsEndpointProducerBuilder traceConnection( + String traceConnection) { + doSetProperty("traceConnection", traceConnection); + return this; + } } /** @@ -1741,6 +1797,34 @@ public interface NatsEndpointBuilderFactory { doSetProperty("synchronous", synchronous); return this; } + /** + * Whether or not connection trace messages should be printed to + * standard out for fine grained debugging of connection issues. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: advanced + */ + default AdvancedNatsEndpointBuilder traceConnection( + boolean traceConnection) { + doSetProperty("traceConnection", traceConnection); + return this; + } + /** + * Whether or not connection trace messages should be printed to + * standard out for fine grained debugging of connection issues. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: advanced + */ + default AdvancedNatsEndpointBuilder traceConnection( + String traceConnection) { + doSetProperty("traceConnection", traceConnection); + return this; + } } public interface NatsBuilders { diff --git a/docs/components/modules/ROOT/pages/nats-component.adoc b/docs/components/modules/ROOT/pages/nats-component.adoc index 9d514a5..36fc2c2 100644 --- a/docs/components/modules/ROOT/pages/nats-component.adoc +++ b/docs/components/modules/ROOT/pages/nats-component.adoc @@ -81,7 +81,7 @@ with the following path and query parameters: |=== -=== Query Parameters (28 parameters): +=== Query Parameters (29 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -113,6 +113,7 @@ with the following path and query parameters: | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *connection* (advanced) | Reference an already instantiated connection to Nats server | | Connection | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean +| *traceConnection* (advanced) | Whether or not connection trace messages should be printed to standard out for fine grained debugging of connection issues. | false | boolean | *secure* (security) | Set secure option indicating TLS is required | false | boolean | *sslContextParameters* (security) | To configure security using SSLContextParameters | | SSLContextParameters |===