on-internet
← Community

Switch case in Apache Camel

Stack Overflow ·

Is there a construct in Apache Camel (in Java DSL) similar to Java switch-case? For example: from( incomingRoute ) .choice() .when( simple( "${body.getType} == '" + TYPE.A.name() + "'" ) ) .to( A_Endpoint ) .when( simple( "${body.getType} == '" + TYPE.B.name() + "'" ) ) .to( B_Endpoint ) .when( simple( "${body.getType} == '" + TYPE.C.name() + "'" ) ) .to( C_Endpoint ) .otherwise() .to( errorEndpoint ); Can be translated into something else more similar to switch? I mean that I do not want to use simple predicates, only value of type of body element. Or is my approach completely wrong? (That co

Comments

Sign in or sign up to comment and upvote.

No comments yet.