How do you want to validate that map's contents?  Do you want to validate
specific fields or key/values?  There are a number of options.  You could
invoke a Java bean or even the Java class you are in if you are using the
Java DSL (which it looks like you are.)

If you use a POJO you might do

.bean(MyValidator.class, "doValidate(${body})") and check or rectify content
in it or possibly throw an exception.  Or use .bean(this,
doValidate(${body})") to validate using the same object.  I don't recall
that exact syntax as I rarely use Java DSL and almost always go from XML to
Java invocations and then when I need to go from Java back to Camel I invoke
routes via endpoints I inject into wrapper classes.  Everything in Java
stays pure Java and everything in Camel stays pure Camel with non mixing. 
so be sure to check the syntax on those if you use them.


There's also the standard Camel validation mechanics.
http://camel.apache.org/validate.html



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-validate-Body-Content-in-Map-Object-tp5779118p5779129.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to