[camel] branch master updated: CAMEL-14177: camel-bean-validator - Allow to turn off xml configuration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated: CAMEL-14177: camel-bean-validator - Allow to turn off xml configuration

davsclaus-2
This is an automated email from the ASF dual-hosted git repository.

davsclaus 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 f46f91e  CAMEL-14177: camel-bean-validator - Allow to turn off xml configuration
f46f91e is described below

commit f46f91e8d0f9175b36e30b11f5b7e5c1ca7b5529
Author: Claus Ibsen <[hidden email]>
AuthorDate: Thu Nov 14 06:13:30 2019 +0100

    CAMEL-14177: camel-bean-validator - Allow to turn off xml configuration
---
 .../src/main/docs/bean-validator-component.adoc    |  14 +-
 .../bean/validator/BeanValidatorComponent.java     |  16 ++
 .../bean/validator/BeanValidatorEndpoint.java      |  23 ++-
 .../bean/validator/ValidatorFactories.java         |   6 +-
 ...nValidatorIgnoreXMLConfigurationRouteTest.java} |  25 +--
 .../dsl/BeanValidatorEndpointBuilderFactory.java   | 202 ++++++++++++---------
 .../ROOT/pages/bean-validator-component.adoc       |  14 +-
 .../BeanValidatorComponentConfiguration.java       |  12 ++
 8 files changed, 186 insertions(+), 126 deletions(-)

diff --git a/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc b/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
index 1a7e33a..355bc898 100644
--- a/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
+++ b/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
@@ -49,13 +49,14 @@ Where *label* is an arbitrary text value describing the endpoint. +
 
 
 // component options: START
-The Bean Validator component supports 3 options, which are listed below.
+The Bean Validator component supports 4 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *ignoreXmlConfiguration* (producer) | Whether to ignore data from the META-INF/validation.xml file. | false | boolean
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *lazyStartProducer* (producer) | 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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
@@ -83,20 +84,21 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (8 parameters):
+=== Query Parameters (9 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *constraintValidatorFactory* (producer) | To use a custom ConstraintValidatorFactory |  | ConstraintValidatorFactory
 | *group* (producer) | To use a custom validation group | javax.validation.groups.Default | String
+| *ignoreXmlConfiguration* (producer) | Whether to ignore data from the META-INF/validation.xml file. | false | boolean
 | *lazyStartProducer* (producer) | 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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *messageInterpolator* (producer) | To use a custom MessageInterpolator |  | MessageInterpolator
-| *traversableResolver* (producer) | To use a custom TraversableResolver |  | TraversableResolver
-| *validationProviderResolver* (producer) | To use a a custom ValidationProviderResolver |  | ValidationProviderResolver
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
+| *constraintValidatorFactory* (advanced) | To use a custom ConstraintValidatorFactory |  | ConstraintValidatorFactory
+| *messageInterpolator* (advanced) | To use a custom MessageInterpolator |  | MessageInterpolator
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
+| *traversableResolver* (advanced) | To use a custom TraversableResolver |  | TraversableResolver
+| *validationProviderResolver* (advanced) | To use a a custom ValidationProviderResolver |  | ValidationProviderResolver
 |===
 // endpoint options: END
 // spring-boot-auto-configure options: START
diff --git a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java
index 4292b37..857cc77 100644
--- a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java
+++ b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.bean.validator;
 import java.util.Map;
 
 import org.apache.camel.Endpoint;
+import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
 
@@ -29,6 +30,9 @@ import org.apache.camel.support.DefaultComponent;
 @Component("bean-validator")
 public class BeanValidatorComponent extends DefaultComponent {
 
+    @Metadata
+    private boolean ignoreXmlConfiguration;
+
     public BeanValidatorComponent() {
     }
 
@@ -36,8 +40,20 @@ public class BeanValidatorComponent extends DefaultComponent {
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         BeanValidatorEndpoint endpoint = new BeanValidatorEndpoint(uri, this);
         endpoint.setLabel(remaining);
+        endpoint.setIgnoreXmlConfiguration(ignoreXmlConfiguration);
         setProperties(endpoint, parameters);
         return endpoint;
     }
 
+    public boolean isIgnoreXmlConfiguration() {
+        return ignoreXmlConfiguration;
+    }
+
+    /**
+     * Whether to ignore data from the META-INF/validation.xml file.
+     */
+    public void setIgnoreXmlConfiguration(boolean ignoreXmlConfiguration) {
+        this.ignoreXmlConfiguration = ignoreXmlConfiguration;
+    }
+
 }
\ No newline at end of file
diff --git a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java
index 6512f2a..ab1412f 100644
--- a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java
+++ b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java
@@ -48,13 +48,15 @@ public class BeanValidatorEndpoint extends DefaultEndpoint {
     @UriParam(defaultValue = "javax.validation.groups.Default")
     private String group;
     @UriParam
+    private boolean ignoreXmlConfiguration;
+    @UriParam(label = "advanced")
     private ValidationProviderResolver validationProviderResolver;
-    @UriParam
+    @UriParam(label = "advanced")
     private MessageInterpolator messageInterpolator;
-    @UriParam
+    @UriParam(label = "advanced")
     private TraversableResolver traversableResolver;
-    @UriParam
-    private ConstraintValidatorFactory constraintValidatorFactory;
+    @UriParam(label = "advanced")
+    private ConstraintValidatorFactory constraintValidatorFactory;
 
     public BeanValidatorEndpoint(String endpointUri, Component component) {
         super(endpointUri, component);
@@ -66,7 +68,7 @@ public class BeanValidatorEndpoint extends DefaultEndpoint {
         if (group != null) {
             producer.setGroup(getCamelContext().getClassResolver().resolveMandatoryClass(group));
         }
-        ValidatorFactory validatorFactory = buildValidatorFactory(isOsgiContext(),
+        ValidatorFactory validatorFactory = buildValidatorFactory(isOsgiContext(), isIgnoreXmlConfiguration(),
                 validationProviderResolver, messageInterpolator, traversableResolver, constraintValidatorFactory);
         producer.setValidatorFactory(validatorFactory);
         return producer;
@@ -105,6 +107,17 @@ public class BeanValidatorEndpoint extends DefaultEndpoint {
         this.group = group;
     }
 
+    public boolean isIgnoreXmlConfiguration() {
+        return ignoreXmlConfiguration;
+    }
+
+    /**
+     * Whether to ignore data from the META-INF/validation.xml file.
+     */
+    public void setIgnoreXmlConfiguration(boolean ignoreXmlConfiguration) {
+        this.ignoreXmlConfiguration = ignoreXmlConfiguration;
+    }
+
     public ValidationProviderResolver getValidationProviderResolver() {
         return validationProviderResolver;
     }
diff --git a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/ValidatorFactories.java b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/ValidatorFactories.java
index c3d4247..46794b8 100644
--- a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/ValidatorFactories.java
+++ b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/ValidatorFactories.java
@@ -33,7 +33,7 @@ public final class ValidatorFactories {
     private ValidatorFactories() {
     }
 
-    public static ValidatorFactory buildValidatorFactory(boolean osgi,
+    public static ValidatorFactory buildValidatorFactory(boolean osgi, boolean ignoreXml,
                                                          ValidationProviderResolver validationProviderResolver,
                                                          MessageInterpolator messageInterpolator,
                                                          TraversableResolver traversableResolver,
@@ -60,6 +60,10 @@ public final class ValidatorFactories {
             configuration.constraintValidatorFactory(constraintValidatorFactory);
         }
 
+        if (ignoreXml) {
+            configuration.ignoreXmlConfiguration();
+        }
+
         return configuration.buildValidatorFactory();
     }
 
diff --git a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java b/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/BeanValidatorIgnoreXMLConfigurationRouteTest.java
similarity index 54%
copy from components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java
copy to components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/BeanValidatorIgnoreXMLConfigurationRouteTest.java
index 4292b37..50813cc 100644
--- a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java
+++ b/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/BeanValidatorIgnoreXMLConfigurationRouteTest.java
@@ -16,28 +16,15 @@
  */
 package org.apache.camel.component.bean.validator;
 
-import java.util.Map;
+import org.apache.camel.CamelContext;
 
-import org.apache.camel.Endpoint;
-import org.apache.camel.spi.annotations.Component;
-import org.apache.camel.support.DefaultComponent;
-
-/**
- * Bean Validator Component for validating Java beans against reference implementation of JSR 303 Validator (Hibernate
- * Validator).
- */
-@Component("bean-validator")
-public class BeanValidatorComponent extends DefaultComponent {
-
-    public BeanValidatorComponent() {
-    }
+public class BeanValidatorIgnoreXMLConfigurationRouteTest extends BeanValidatorRouteTest {
 
     @Override
-    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
-        BeanValidatorEndpoint endpoint = new BeanValidatorEndpoint(uri, this);
-        endpoint.setLabel(remaining);
-        setProperties(endpoint, parameters);
-        return endpoint;
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext camel = super.createCamelContext();
+        camel.getComponent("bean-validator", BeanValidatorComponent.class).setIgnoreXmlConfiguration(true);
+        return camel;
     }
 
 }
\ No newline at end of file
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/BeanValidatorEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/BeanValidatorEndpointBuilderFactory.java
index 96daba7..97025c1 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/BeanValidatorEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/BeanValidatorEndpointBuilderFactory.java
@@ -41,40 +41,38 @@ public interface BeanValidatorEndpointBuilderFactory {
             return (AdvancedBeanValidatorEndpointBuilder) this;
         }
         /**
-         * To use a custom ConstraintValidatorFactory.
+         * To use a custom validation group.
          *
-         * The option is a:
-         * <code>javax.validation.ConstraintValidatorFactory</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          *
          * Group: producer
          */
-        default BeanValidatorEndpointBuilder constraintValidatorFactory(
-                Object constraintValidatorFactory) {
-            doSetProperty("constraintValidatorFactory", constraintValidatorFactory);
+        default BeanValidatorEndpointBuilder group(String group) {
+            doSetProperty("group", group);
             return this;
         }
         /**
-         * To use a custom ConstraintValidatorFactory.
+         * Whether to ignore data from the META-INF/validation.xml file.
          *
-         * The option will be converted to a
-         * <code>javax.validation.ConstraintValidatorFactory</code> type.
+         * The option is a: <code>boolean</code> type.
          *
          * Group: producer
          */
-        default BeanValidatorEndpointBuilder constraintValidatorFactory(
-                String constraintValidatorFactory) {
-            doSetProperty("constraintValidatorFactory", constraintValidatorFactory);
+        default BeanValidatorEndpointBuilder ignoreXmlConfiguration(
+                boolean ignoreXmlConfiguration) {
+            doSetProperty("ignoreXmlConfiguration", ignoreXmlConfiguration);
             return this;
         }
         /**
-         * To use a custom validation group.
+         * Whether to ignore data from the META-INF/validation.xml file.
          *
-         * The option is a: <code>java.lang.String</code> type.
+         * The option will be converted to a <code>boolean</code> type.
          *
          * Group: producer
          */
-        default BeanValidatorEndpointBuilder group(String group) {
-            doSetProperty("group", group);
+        default BeanValidatorEndpointBuilder ignoreXmlConfiguration(
+                String ignoreXmlConfiguration) {
+            doSetProperty("ignoreXmlConfiguration", ignoreXmlConfiguration);
             return this;
         }
         /**
@@ -117,145 +115,171 @@ public interface BeanValidatorEndpointBuilderFactory {
             doSetProperty("lazyStartProducer", lazyStartProducer);
             return this;
         }
+    }
+
+    /**
+     * Advanced builder for endpoint for the Bean Validator component.
+     */
+    public interface AdvancedBeanValidatorEndpointBuilder
+            extends
+                EndpointProducerBuilder {
+        default BeanValidatorEndpointBuilder basic() {
+            return (BeanValidatorEndpointBuilder) this;
+        }
         /**
-         * To use a custom MessageInterpolator.
+         * Whether the endpoint should use basic property binding (Camel 2.x) or
+         * the newer property binding with additional capabilities.
          *
-         * The option is a: <code>javax.validation.MessageInterpolator</code>
-         * type.
+         * The option is a: <code>boolean</code> type.
          *
-         * Group: producer
+         * Group: advanced
          */
-        default BeanValidatorEndpointBuilder messageInterpolator(
-                Object messageInterpolator) {
-            doSetProperty("messageInterpolator", messageInterpolator);
+        default AdvancedBeanValidatorEndpointBuilder basicPropertyBinding(
+                boolean basicPropertyBinding) {
+            doSetProperty("basicPropertyBinding", basicPropertyBinding);
             return this;
         }
         /**
-         * To use a custom MessageInterpolator.
+         * Whether the endpoint should use basic property binding (Camel 2.x) or
+         * the newer property binding with additional capabilities.
          *
-         * The option will be converted to a
-         * <code>javax.validation.MessageInterpolator</code> type.
+         * The option will be converted to a <code>boolean</code> type.
          *
-         * Group: producer
+         * Group: advanced
          */
-        default BeanValidatorEndpointBuilder messageInterpolator(
-                String messageInterpolator) {
-            doSetProperty("messageInterpolator", messageInterpolator);
+        default AdvancedBeanValidatorEndpointBuilder basicPropertyBinding(
+                String basicPropertyBinding) {
+            doSetProperty("basicPropertyBinding", basicPropertyBinding);
             return this;
         }
         /**
-         * To use a custom TraversableResolver.
+         * To use a custom ConstraintValidatorFactory.
          *
-         * The option is a: <code>javax.validation.TraversableResolver</code>
-         * type.
+         * The option is a:
+         * <code>javax.validation.ConstraintValidatorFactory</code> type.
          *
-         * Group: producer
+         * Group: advanced
          */
-        default BeanValidatorEndpointBuilder traversableResolver(
-                Object traversableResolver) {
-            doSetProperty("traversableResolver", traversableResolver);
+        default AdvancedBeanValidatorEndpointBuilder constraintValidatorFactory(
+                Object constraintValidatorFactory) {
+            doSetProperty("constraintValidatorFactory", constraintValidatorFactory);
             return this;
         }
         /**
-         * To use a custom TraversableResolver.
+         * To use a custom ConstraintValidatorFactory.
          *
          * The option will be converted to a
-         * <code>javax.validation.TraversableResolver</code> type.
+         * <code>javax.validation.ConstraintValidatorFactory</code> type.
          *
-         * Group: producer
+         * Group: advanced
          */
-        default BeanValidatorEndpointBuilder traversableResolver(
-                String traversableResolver) {
-            doSetProperty("traversableResolver", traversableResolver);
+        default AdvancedBeanValidatorEndpointBuilder constraintValidatorFactory(
+                String constraintValidatorFactory) {
+            doSetProperty("constraintValidatorFactory", constraintValidatorFactory);
             return this;
         }
         /**
-         * To use a a custom ValidationProviderResolver.
+         * To use a custom MessageInterpolator.
          *
-         * The option is a:
-         * <code>javax.validation.ValidationProviderResolver</code> type.
+         * The option is a: <code>javax.validation.MessageInterpolator</code>
+         * type.
          *
-         * Group: producer
+         * Group: advanced
          */
-        default BeanValidatorEndpointBuilder validationProviderResolver(
-                Object validationProviderResolver) {
-            doSetProperty("validationProviderResolver", validationProviderResolver);
+        default AdvancedBeanValidatorEndpointBuilder messageInterpolator(
+                Object messageInterpolator) {
+            doSetProperty("messageInterpolator", messageInterpolator);
             return this;
         }
         /**
-         * To use a a custom ValidationProviderResolver.
+         * To use a custom MessageInterpolator.
          *
          * The option will be converted to a
-         * <code>javax.validation.ValidationProviderResolver</code> type.
+         * <code>javax.validation.MessageInterpolator</code> type.
          *
-         * Group: producer
+         * Group: advanced
          */
-        default BeanValidatorEndpointBuilder validationProviderResolver(
-                String validationProviderResolver) {
-            doSetProperty("validationProviderResolver", validationProviderResolver);
+        default AdvancedBeanValidatorEndpointBuilder messageInterpolator(
+                String messageInterpolator) {
+            doSetProperty("messageInterpolator", messageInterpolator);
             return this;
         }
-    }
-
-    /**
-     * Advanced builder for endpoint for the Bean Validator component.
-     */
-    public interface AdvancedBeanValidatorEndpointBuilder
-            extends
-                EndpointProducerBuilder {
-        default BeanValidatorEndpointBuilder basic() {
-            return (BeanValidatorEndpointBuilder) this;
-        }
         /**
-         * Whether the endpoint should use basic property binding (Camel 2.x) or
-         * the newer property binding with additional capabilities.
+         * Sets whether synchronous processing should be strictly used, or Camel
+         * is allowed to use asynchronous processing (if supported).
          *
          * The option is a: <code>boolean</code> type.
          *
          * Group: advanced
          */
-        default AdvancedBeanValidatorEndpointBuilder basicPropertyBinding(
-                boolean basicPropertyBinding) {
-            doSetProperty("basicPropertyBinding", basicPropertyBinding);
+        default AdvancedBeanValidatorEndpointBuilder synchronous(
+                boolean synchronous) {
+            doSetProperty("synchronous", synchronous);
             return this;
         }
         /**
-         * Whether the endpoint should use basic property binding (Camel 2.x) or
-         * the newer property binding with additional capabilities.
+         * Sets whether synchronous processing should be strictly used, or Camel
+         * is allowed to use asynchronous processing (if supported).
          *
          * The option will be converted to a <code>boolean</code> type.
          *
          * Group: advanced
          */
-        default AdvancedBeanValidatorEndpointBuilder basicPropertyBinding(
-                String basicPropertyBinding) {
-            doSetProperty("basicPropertyBinding", basicPropertyBinding);
+        default AdvancedBeanValidatorEndpointBuilder synchronous(
+                String synchronous) {
+            doSetProperty("synchronous", synchronous);
             return this;
         }
         /**
-         * Sets whether synchronous processing should be strictly used, or Camel
-         * is allowed to use asynchronous processing (if supported).
+         * To use a custom TraversableResolver.
          *
-         * The option is a: <code>boolean</code> type.
+         * The option is a: <code>javax.validation.TraversableResolver</code>
+         * type.
          *
          * Group: advanced
          */
-        default AdvancedBeanValidatorEndpointBuilder synchronous(
-                boolean synchronous) {
-            doSetProperty("synchronous", synchronous);
+        default AdvancedBeanValidatorEndpointBuilder traversableResolver(
+                Object traversableResolver) {
+            doSetProperty("traversableResolver", traversableResolver);
             return this;
         }
         /**
-         * Sets whether synchronous processing should be strictly used, or Camel
-         * is allowed to use asynchronous processing (if supported).
+         * To use a custom TraversableResolver.
          *
-         * The option will be converted to a <code>boolean</code> type.
+         * The option will be converted to a
+         * <code>javax.validation.TraversableResolver</code> type.
          *
          * Group: advanced
          */
-        default AdvancedBeanValidatorEndpointBuilder synchronous(
-                String synchronous) {
-            doSetProperty("synchronous", synchronous);
+        default AdvancedBeanValidatorEndpointBuilder traversableResolver(
+                String traversableResolver) {
+            doSetProperty("traversableResolver", traversableResolver);
+            return this;
+        }
+        /**
+         * To use a a custom ValidationProviderResolver.
+         *
+         * The option is a:
+         * <code>javax.validation.ValidationProviderResolver</code> type.
+         *
+         * Group: advanced
+         */
+        default AdvancedBeanValidatorEndpointBuilder validationProviderResolver(
+                Object validationProviderResolver) {
+            doSetProperty("validationProviderResolver", validationProviderResolver);
+            return this;
+        }
+        /**
+         * To use a a custom ValidationProviderResolver.
+         *
+         * The option will be converted to a
+         * <code>javax.validation.ValidationProviderResolver</code> type.
+         *
+         * Group: advanced
+         */
+        default AdvancedBeanValidatorEndpointBuilder validationProviderResolver(
+                String validationProviderResolver) {
+            doSetProperty("validationProviderResolver", validationProviderResolver);
             return this;
         }
     }
diff --git a/docs/components/modules/ROOT/pages/bean-validator-component.adoc b/docs/components/modules/ROOT/pages/bean-validator-component.adoc
index bce82f1..6d4d991 100644
--- a/docs/components/modules/ROOT/pages/bean-validator-component.adoc
+++ b/docs/components/modules/ROOT/pages/bean-validator-component.adoc
@@ -50,13 +50,14 @@ Where *label* is an arbitrary text value describing the endpoint. +
 
 
 // component options: START
-The Bean Validator component supports 3 options, which are listed below.
+The Bean Validator component supports 4 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *ignoreXmlConfiguration* (producer) | Whether to ignore data from the META-INF/validation.xml file. | false | boolean
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *lazyStartProducer* (producer) | 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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
@@ -84,20 +85,21 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (8 parameters):
+=== Query Parameters (9 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *constraintValidatorFactory* (producer) | To use a custom ConstraintValidatorFactory |  | ConstraintValidatorFactory
 | *group* (producer) | To use a custom validation group | javax.validation.groups.Default | String
+| *ignoreXmlConfiguration* (producer) | Whether to ignore data from the META-INF/validation.xml file. | false | boolean
 | *lazyStartProducer* (producer) | 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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *messageInterpolator* (producer) | To use a custom MessageInterpolator |  | MessageInterpolator
-| *traversableResolver* (producer) | To use a custom TraversableResolver |  | TraversableResolver
-| *validationProviderResolver* (producer) | To use a a custom ValidationProviderResolver |  | ValidationProviderResolver
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
+| *constraintValidatorFactory* (advanced) | To use a custom ConstraintValidatorFactory |  | ConstraintValidatorFactory
+| *messageInterpolator* (advanced) | To use a custom MessageInterpolator |  | MessageInterpolator
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
+| *traversableResolver* (advanced) | To use a custom TraversableResolver |  | TraversableResolver
+| *validationProviderResolver* (advanced) | To use a a custom ValidationProviderResolver |  | ValidationProviderResolver
 |===
 // endpoint options: END
 // spring-boot-auto-configure options: START
diff --git a/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConfiguration.java
index 427e884..40e7e9c 100644
--- a/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConfiguration.java
@@ -38,6 +38,10 @@ public class BeanValidatorComponentConfiguration
      */
     private Boolean enabled;
     /**
+     * Whether to ignore data from the META-INF/validation.xml file.
+     */
+    private Boolean ignoreXmlConfiguration = false;
+    /**
      * Whether the component should use basic property binding (Camel 2.x) or
      * the newer property binding with additional capabilities
      */
@@ -63,6 +67,14 @@ public class BeanValidatorComponentConfiguration
      */
     private Boolean bridgeErrorHandler = false;
 
+    public Boolean getIgnoreXmlConfiguration() {
+        return ignoreXmlConfiguration;
+    }
+
+    public void setIgnoreXmlConfiguration(Boolean ignoreXmlConfiguration) {
+        this.ignoreXmlConfiguration = ignoreXmlConfiguration;
+    }
+
     public Boolean getBasicPropertyBinding() {
         return basicPropertyBinding;
     }