Apache Camel : “direct:start” endpoint - what does it mean ?

前端 未结 7 708
既然无缘
既然无缘 2021-02-02 05:38

I\'m new to Apache Camel. Can someone explain what \"direct:start\" means in Camel. Please see

http://camel.apache.org/http

from(\"direct:start\")
.to(         


        
相关标签:
7条回答
  • 2021-02-02 06:33

    It should be fairly easy to explain: exchange is always sent from a source to a destination. For that to happen, you need to create those 02 routes: one will consume (yes the start) and the other one will emit. from("direct:start") means "directly consume the exchange from the "start" route and process it anyhow. to("direct:start") means "send" the exchange to the "start" route "directly" within the same camel context. What makes this really ambiguous is that the route itself (i.e: "direct:start") is implicitly created on the fly so when writing your code, you are assuming that there is a route called "direct:start" so you can retrieve exchange from it but you can also send an exchange to it. Good luck!

    0 讨论(0)
提交回复
热议问题