Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from(URI)
- .errorHandler(deadLetterChannel(format("log:%s?level=ERROR", MyClass.class.getName())))
- .onException(Throwable.class)
- .maximumRedeliveries(5).redeliveryDelay("1000")
- .to("log:error?showCaughtException=true")
- .end()
- .to("direct:first")
- .hystrix()
- .hystrixConfiguration()
- .end()
- .to("direct:second")
- .endHystrix()
- .to("direct:third")
- .to("log:success?level=INFO");
- // ENDPOINTS
- @Consume(uri="direct:first")
- public String first(String payload) {
- return payload + " first";
- }
- @Consume(uri="direct:second")
- public String second(String payload) {
- Random rand = new Random();
- if ((rand.nextInt() % 3) == 0) {
- throw new RuntimeException("msg");
- }
- return payload + " second";
- }
- @Consume(uri="direct:third")
- public String third(String payload) {
- return payload + " third";
- }
Add Comment
Please, Sign In to add comment