Apache Camel 和 Intellij Idea 代码格式
2022-09-04 21:19:29
Intellij Idea将骆驼溃败中的代码格式化为如下所示:
from("direct:loop")
.log("Loop: ${header[loopCount]}")
.choice()
.when(simple("header[loopCount] < 10"))
.process(exchange -> {
Message in = exchange.getIn();
in.setHeader("loopCount", in.getHeader("loopCount", Integer.class) + 1);
})
.to("direct:loop")
.otherwise()
.log("Exiting loop")
.end();
是否有任何插件或其他方法可以做到这一点:
from("direct:loop")
.log("Loop: ${header[loopCount]}")
.choice()
.when(simple("header[loopCount] < 10"))
.process(exchange -> {
Message in = exchange.getIn();
in.setHeader("loopCount", in.getHeader("loopCount", Integer.class) + 1);
})
.to("direct:loop")
.otherwise()
.log("Exiting loop")
.end();
?