You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2024/04/19 17:40:34 UTC
(camel) branch CAMEL-20692/set-default-value-for-loggingSizeLimit updated (6b62ef31938 -> 0a94d8cb91a)
This is an automated email from the ASF dual-hosted git repository.
nfilotto pushed a change to branch CAMEL-20692/set-default-value-for-loggingSizeLimit
in repository https://gitbox.apache.org/repos/asf/camel.git
discard 6b62ef31938 CAMEL-20692: camel-cxf - Set properly a default value for loggingSizeLimit
new 0a94d8cb91a CAMEL-20692: camel-cxf - Set a default value for loggingSizeLimit
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (6b62ef31938)
\
N -- N -- N refs/heads/CAMEL-20692/set-default-value-for-loggingSizeLimit (0a94d8cb91a)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
(camel) 01/01: CAMEL-20692: camel-cxf - Set a default value for loggingSizeLimit
Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nfilotto pushed a commit to branch CAMEL-20692/set-default-value-for-loggingSizeLimit
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0a94d8cb91ae4cb82e22ce66dafaedc19f3e382e
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Fri Apr 19 19:37:27 2024 +0200
CAMEL-20692: camel-cxf - Set a default value for loggingSizeLimit
---
.../org/apache/camel/component/cxf/jaxrs/cxfrs.json | 6 +++---
.../apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java | 15 ++++++++++-----
.../org/apache/camel/component/cxf/jaxws/CxfEndpoint.java | 2 +-
3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/components/camel-cxf/camel-cxf-rest/src/generated/resources/org/apache/camel/component/cxf/jaxrs/cxfrs.json b/components/camel-cxf/camel-cxf-rest/src/generated/resources/org/apache/camel/component/cxf/jaxrs/cxfrs.json
index 06e5bb01cce..167b1b46756 100644
--- a/components/camel-cxf/camel-cxf-rest/src/generated/resources/org/apache/camel/component/cxf/jaxrs/cxfrs.json
+++ b/components/camel-cxf/camel-cxf-rest/src/generated/resources/org/apache/camel/component/cxf/jaxrs/cxfrs.json
@@ -50,8 +50,6 @@
"beanId": { "kind": "path", "displayName": "Bean Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To lookup an existing configured CxfRsEndpoint. Must used bean: as prefix." },
"address": { "kind": "path", "displayName": "Address", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The service publish address." },
"features": { "kind": "parameter", "displayName": "Features", "group": "common", "label": "", "required": false, "type": "array", "javaType": "java.util.List<org.apache.cxf.feature.Feature>", "deprecated": false, "autowired": false, "secret": false, "description": "Set the feature list to the CxfRs endpoint." },
- "loggingFeatureEnabled": { "kind": "parameter", "displayName": "Logging Feature Enabled", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "This option enables CXF Logging Feature which writes inbound and outbound REST messages to log." },
- "loggingSizeLimit": { "kind": "parameter", "displayName": "Logging Size Limit", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To limit the total size of number of bytes the logger will output when logging feature has been enabled." },
"modelRef": { "kind": "parameter", "displayName": "Model Ref", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "This option is used to specify the model file which is useful for the resource class without annotation. When using this option, then the service class can be omitted, to emulate document-only endpoints" },
"providers": { "kind": "parameter", "displayName": "Providers", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set custom JAX-RS provider(s) list to the CxfRs endpoint. You can specify a string with a list of providers to lookup in the registy separated by comma." },
"resourceClasses": { "kind": "parameter", "displayName": "Resource Classes", "group": "common", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.Class<java.lang.Object>>", "deprecated": false, "autowired": false, "secret": false, "description": "The resource classes which you want to export as REST service. Multiple classes can be separated by comma." },
@@ -79,6 +77,8 @@
"defaultBus": { "kind": "parameter", "displayName": "Default Bus", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will set the default bus when CXF endpoint create a bus by itself" },
"headerFilterStrategy": { "kind": "parameter", "displayName": "Header Filter Strategy", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HeaderFilterStrategy to filter header to and from Camel message." },
"performInvocation": { "kind": "parameter", "displayName": "Perform Invocation", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "When the option is true, Camel will perform the invocation of the resource class instance and put the response object into the exchange for further processing." },
- "propagateContexts": { "kind": "parameter", "displayName": "Propagate Contexts", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "When the option is true, JAXRS UriInfo, HttpHeaders, Request and SecurityContext contexts will be available to custom CXFRS processors as typed Camel exchange properties. These contexts can be used to analyz [...]
+ "propagateContexts": { "kind": "parameter", "displayName": "Propagate Contexts", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "When the option is true, JAXRS UriInfo, HttpHeaders, Request and SecurityContext contexts will be available to custom CXFRS processors as typed Camel exchange properties. These contexts can be used to analyz [...]
+ "loggingFeatureEnabled": { "kind": "parameter", "displayName": "Logging Feature Enabled", "group": "logging", "label": "logging", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "This option enables CXF Logging Feature which writes inbound and outbound REST messages to log." },
+ "loggingSizeLimit": { "kind": "parameter", "displayName": "Logging Size Limit", "group": "logging", "label": "logging", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 49152, "description": "To limit the total size of number of bytes the logger will output when logging feature has been enabled and -1 for no limit." }
}
}
diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index 09711197e16..97fefa84ffe 100644
--- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -48,6 +48,7 @@ import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.ext.logging.AbstractLoggingInterceptor;
import org.apache.cxf.ext.logging.LoggingFeature;
import org.apache.cxf.feature.Feature;
import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
@@ -121,10 +122,10 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
private SSLContextParameters sslContextParameters;
@UriParam(label = "producer")
private HostnameVerifier hostnameVerifier;
- @UriParam
+ @UriParam(label = "logging")
private boolean loggingFeatureEnabled;
- @UriParam
- private int loggingSizeLimit;
+ @UriParam(label = "logging", defaultValue = "" + AbstractLoggingInterceptor.DEFAULT_LIMIT)
+ private int loggingSizeLimit = AbstractLoggingInterceptor.DEFAULT_LIMIT;
@UriParam
private boolean skipFaultLogging;
@UriParam(label = "advanced", defaultValue = "30000", javaType = "java.time.Duration")
@@ -377,7 +378,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
if (isLoggingFeatureEnabled()) {
LoggingFeature loggingFeature = new LoggingFeature();
- if (getLoggingSizeLimit() > 0) {
+ if (getLoggingSizeLimit() >= -1) {
loggingFeature.setLimit(getLoggingSizeLimit());
}
factory.getFeatures().add(loggingFeature);
@@ -527,9 +528,13 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
}
/**
- * To limit the total size of number of bytes the logger will output when logging feature has been enabled.
+ * To limit the total size of number of bytes the logger will output when logging feature has been enabled and -1
+ * for no limit.
*/
public void setLoggingSizeLimit(int loggingSizeLimit) {
+ if (loggingSizeLimit < -1) {
+ throw new IllegalArgumentException("LoggingSizeLimit must be greater or equal to -1.");
+ }
this.loggingSizeLimit = loggingSizeLimit;
}
diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java
index b7bcadfa0c8..25d77839229 100644
--- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java
+++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java
@@ -191,7 +191,7 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
@UriParam(label = "logging")
private boolean loggingFeatureEnabled;
@UriParam(label = "logging", defaultValue = "" + AbstractLoggingInterceptor.DEFAULT_LIMIT)
- private int loggingSizeLimit;
+ private int loggingSizeLimit = AbstractLoggingInterceptor.DEFAULT_LIMIT;
@UriParam(label = "advanced")
private boolean mtomEnabled;
@UriParam(label = "advanced")