note of camel in action--chapter 1 introduction of relevant concepts

1 Message

    

     Headers are name-value pairs; the name is a unique, case-insensitive string, and the value is of type java.lang.Object .Headers are values associated with the message, such as sender
identifiers, hints about content encoding, authentication information, and so on.  And one point must be born in mind that Headers is the concept within Message or within one route, this is a big difference from Property.

      Attachments are typically used for the web service and email components.

      The body is of type java.lang.Object, When the sender and receiver use different body formats, Camel provides a number of mechanisms to transform the data into an acceptable format, and in  many cases the conversion happens automatically with type converters, behind the scenes.

  2  Exchange

    

 

    MEP —A pattern that denotes whether you’re using the InOnly or InOut messaging style. When the pattern is InOnly , the exchange contains an in message. For
InOut , an out message also exists that contains the reply message for the caller.

   Exception—If an error occurs at any time during routing, an Exception will be set in the exception field.
   Properties—Similar to message headers, but they last for the duration of the entire exchange. Properties are used to contain global-level (in the whole camelcontxt)information,whereas message headers are specific to a particular message(bear in mind this difference, otherwise you 'll probably be confused while learing the Sil). Camel itself will add various properties to the exchange during routing. You, as a developer, can store and retrieve properties at any point during the lifetime of an exchange.
   In message—This is the input message, which is mandatory. The in message contains the request message.
   Out message—This is an optional message that only exists if the MEP is InOut .The out message contains the reply message.

   3  Camel Architecture

 

  from the pic above , you are supposed to figure out what is an entire route in a piece of code.

  CamelContext is , to some extend , like the Application in Spring, it actually is a container

  

     besides those concepts ,there are also Producer and Consumer, Produce is usually instantiated by using ProduceTemplate

     3. 1 Producer

    When a message needs to be sent to an endpoint, the producer will create an exchange and populate it with data compatible with that particular endpoint.For example, a FileProducer will write the message body to a file. A JmsProducer , on the other hand, will map the Camel message to a javax.jms.Message before sending it to a JMS destination

     3.2 Consumer

   

    

    A consumer is the service that receives messages produced by a producer, wraps them in an exchange, and sends them to be processed. Consumers are the source of the exchanges being routed in Camel

转载于:https://www.cnblogs.com/liuheng0213/p/10527539.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值