是否可以通过Exchange
检索在执行时用于构建Route的RouteBuilder
类?
class SimplePingRoute : RouteBuilder() {
override fun configure() {
from("timer://foo?fixedRate=true&period=1000")
.routeId("pong-demo-app")
.process({exc->
//***looking for SimplePingRoute at this point from exc***
})
.to("log:pong")
}}
2条答案
按热度按时间xbp102n01#
一个Java示例,但很容易转换为您选择的语言:
yizd12fk2#
为什么不将routebuilder存储在一个exchange属性中,以便在以后的处理中始终可用?