Camel In Action 读书笔记 (1)

<h2 align="center">Camel’s message model --- Camel的消息模型</h2> <p>&#160;&#160;&#160;&#160; Camel中的有两种抽象的消息类型:</p> <p>&#160;&#160;&#160;&#160;&#160;&#160; org.apache.camel.Message----是消息的基本的实体。</p> <p>&#160;&#160;&#160;&#160;&#160; org.apache.camel.Exchange---描述消息的一次交换。exchange包含一条流入(in)的Message,若是有应答则还有一条流出(out)的Message.</p> <h3>&#160;&#160; Message</h3> <blockquote> <p>message有三部分组成:body(有效负载)、headers、Attachments ;mesage有一个全局惟一标示(identifier),类型为(java.lang.String).</p> </blockquote> <p><a href="http://static.oschina.net/uploads/img/201305/31145347_C6q2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://static.oschina.net/uploads/img/201305/31145347_QaZ8.png" width="172" height="244" /></a> </p> <p>&#160;</p> <h4>HEADERS AND ATTACHMENTS</h4> <p>Headers放的是消息相关的信息,好比消息发送者(sender),消息编码(encode),验证信息….</p> <p>Headers经过key-value的形式存储数据。key是String型,value是Object型。</p> <p>消息也能够包含附件经常使用在web service 和 email的路由中。</p> <h4>BODY</h4> <p>body是Object型能够用来存听任何数据。</p> <h4>FAULT FLAG</h4> <p>有部分协议如(WSDL,JBI)区分输出(output)与错误消息。</p> <h3> Exchange</h3> <p>exchange包含以下图所示:</p> <p><a href="http://static.oschina.net/uploads/img/201305/31145348_UBT3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://static.oschina.net/uploads/img/201305/31145348_xWA5.png" width="223" height="244" /></a> </p> <p>MEP用来区分交互类型:</p> <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InOnly表明单向模式(one way),好比JMS</p> <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InOut表明还应答模式(request-response).好比HTTP</p>java

相关文章
相关标签/搜索