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

前端 未结 7 706
既然无缘
既然无缘 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:28

    Apache Camel direct is basically for sending Exchange from one route to another in SAME Camel context. So let’s say you are getting message from AMQ and you want to populate headers for every message you get and then send it to mail recipient list. So here you need to create new router which has following description

    from(“direct:populateHeaders”)
    .setHeader(“myHeader”, “myHeaderValue”)
    .end()
    

    And from any route you can send your Exchange object to this route by writing

    ...
    
    .to(“direct:populateHeaders”)
    
    ...
    

    Its important to keep in mind that this will not work out of your Camel Context.

提交回复
热议问题