Available as of Camel 2.3
Maven users will need to add the following dependency to their pom.xml for this component:
Where something must be present to provide a valid url
The bean-validator when deployed in an OSGi environment requires a little help to accommodate the resource loading specified in JSR303, this was fixed in Servicemix-Specs 1.6-SNAPSHOT.
Assumed we have a java bean with the following annotations
and an interface definition for our custom validation group
with the following Camel route, only the @NotNull constraints on the attributes manufacturer and licensePlate will be validated (Camel uses the default group javax.validation.groups.Default).
If you want to check the constraints from the group OptionalChecks, you have to define the route like this
If you want to check the constraints from both groups, you have to define a new interface first
and then your route definition should looks like this
And if you have to provide your own message interpolator, traversable resolver and constraint validator factory, you have to write a route like this
It's also possible to describe your constraints as XML and not as Java annotations. In this case, you have to provide the file META-INF/validation.xml which could looks like this
and the constraints-car.xml file