Validating the class of Object available in camel exchange body

In camel routes, we can validate┬áthe class of object available in Camel exchange body. It can be achieved by using below code: CamelContext context = new DefaultCamelContext(); try { context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from(“direct:validateInputObject”) .choice() .when(simple(“${body} is ‘java.util.List'”)) .log(LoggingLevel.INFO, “Body contains java.util.List object”) .when(simple(“${body} is ‘java.lang.String'”)) .log(LoggingLevel.INFO, “Body contains Read More…