Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 12. Bean Validator


Validate the message body using the Java Bean Validation API.

12.1. What’s inside

Please refer to the above link for usage and configuration details.

12.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-bean-validator</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

12.3. Usage

12.3.1. Configuring the ValidatorFactory

Implementation of this extension leverages the Quarkus Hibernate Validator extension.

Therefore it is not possible to configure the ValidatorFactory by Camel’s properties (constraintValidatorFactory, messageInterpolator, traversableResolver, validationProviderResolver and validatorFactory).

You can configure the ValidatorFactory by the creation of beans which will be injected into the default ValidatorFactory (created by Quarkus). See the Quarkus CDI documentation for more information.

12.3.2. Custom validation groups in native mode

When using custom validation groups in native mode, all the interfaces need to be registered for reflection (see the documentation).

Example:

@RegisterForReflection
public interface OptionalChecks {
}
Copy to Clipboard Toggle word wrap

12.4. Camel Quarkus limitations

It is not possible to describe your constraints as XML (by providing the file META-INF/validation.xml), only Java annotations are supported. This is caused by the limitation of the Quarkus Hibernate Validator extension (see the issue).

Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat