ValidatePage edited by Eric JohnsonChanges (10)
Full ContentValidateAvailable as of Camel 2.3 Validate uses an _expression_ or predicates to validate the contents of a message. It is useful for ensuring that messages are valid before attempting to process them. You can use the validate DSL with all kind of Predicates and Expressions. Validate evaluates the Predicate/_expression_ and if it is false a PredicateValidationException is thrown. If it is true message processing continues. Using from Java DSLThe route below will read the file contents and validate them against a regular _expression_. from("file://inbox") .validate(body(String.class).regex("^\\w{10}\\,\\d{2}\\,\\w{24}$")) .to("bean:MyServiceBean.processLine");
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|