文档章节

Camel概念【Exchange 】

k_k_anna
 k_k_anna
发布于 2015/01/27 22:25
字数 552
阅读 426
收藏 1

Exchange

An exchange in Camel is the message’s container during routing. (在camel中,exchange被当做路由交换的容器)

An exchange also provides support for the various types of interactions between systems, also known as message exchange patterns ( MEP s).  MEP s are used to differentiate between one-way and request-response messaging styles. The Camel exchange holds a pattern property that can be either

(exchange还为不同种类的系统交互提供了支持,这也被称作消息交互模式,MEP用于区分单向和交互的信息请求,exchange有着这样的模式特性:)
InOnly —A one-way message (also known as an  Event message).
For example,  JMS messaging is often one-way messaging.
InOut —A request-response message. For example,  HTTP -based transports are often request reply, where a client requests to retrieve a web page, waiting for the reply from the server.
Figure 1.5 illustrates the contents of an exchange in Camel.

Let’s look at the elements of figure 1.5 in more detail:
Exchange  ID —A unique  ID that identifies the exchange. Camel will generate a default unique  ID ,if you don’t explicitly set one.(Exchange  ID 唯一id标识exchange,如果不显式的设置id值,camel将自动生成默认id)
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.(记录InOnly或InOut的模式)

Exception—If an error occurs at any time during routing, an  Exception will be set in the exception field.
Properties—Similar to message headers(和message中的header很相似), but they last for the duration of the entire exchange. (但他在整个exchange过程中持续)Properties are used to contain global-level information(Properties用于存放全局信息), where as message headers are specific to a particular message. 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.(在路由交换时,camel自身将向exchange中添加种类繁多的property,作为开发者的你,可以在exchange生命周期的任何时间点存取property
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 (当模式为Inout时,才有).The out message contains the reply message.


We discussed Camel’s message model before the architecture because we wanted you to have a solid understanding of what a message is in Camel. After all, the most important aspect of Camel is routing messages. You’re now well prepared to learn more about Camel and its architecture.

© 著作权归作者所有

上一篇: Mysql日期
k_k_anna
粉丝 13
博文 52
码字总数 3024
作品 0
海淀
程序员
私信 提问
Camel概念【Camel’s message model(消息体模型)】

Camel’s message model In Camel, there are two abstractions for modeling messages, both of which we’ll cover in this section.(Camel中有两个抽象的消息体模型) org.apache.camel......

k_k_anna
2015/01/27
101
0
Apache Camel 2.15.5 发布,规则引擎

Apache Camel 2.15.5 发布,此版本更新内容如下: Bug 修复 [CAMEL-9161] - Camel spring-boot not finding routes when using spring-cloud [CAMEL-9202] - Flatpack: Body reader never c......

淡漠悠然
2015/12/01
1.7K
2
Apache Camel 2.17.1 发布,路由以及媒介引擎

Apache Camel 2.17.1 发布了,一些提升及新特性: [CAMEL-9574] - Be able to force one-way operation when using camel-cxf transport [CAMEL-9883] - Add a SpringCache based idempotent......

淡漠悠然
2016/05/09
1.2K
2
Apache Camel简介与入门

Apache Camel 是一个基于知名的企业应用模式(Enterprise Integration Patterns)多功能的整合框架. StackOverflow上有很多学习Apache Camel的资源,而这里仅仅是使用一个实例来简单的介绍一...

王振威
2012/09/23
4.8W
15
Camel In Action 读书笔记 (5)

接下来说说第四章, 第四章介绍如何在Camel中使用普通bean,关于bean的使用方式前面已有介绍:javaDSL和SpringDSL两种方式。 下面讲下bean的Camel中的使用模式。 The Service Activator patt...

vidy_tu
2013/06/09
596
0

没有更多内容

加载失败,请刷新页面

加载更多

Kettle自定义jar包供javascript使用

我们都知道 Kettle 是用 Java 语言开发,并且可以在 JavaScript 里面直接调用 java 类方法。所以有些时候,我们可以自定义一些方法,来供 JavaScript 使用。 本篇文章有参考自:https://www...

CREATE_17
昨天
82
0
处理CSV文件中的逗号

我正在寻找有关如何处理正在创建的csv文件的建议,然后由我们的客户上传,并且该值可能带有逗号(例如公司名称)。 我们正在研究的一些想法是:带引号的标识符(值“,”值“,”等)或使用|...

javail
昨天
79
0
如何克隆一个Date对象?

将Date变量分配给另一个变量会将引用复制到同一实例。 这意味着更改一个将更改另一个。 如何实际克隆或复制Date实例? #1楼 简化版: Date.prototype.clone = function () { return new ...

技术盛宴
昨天
73
0
计算一个数的数位之和

计算一个数的数位之和 例如:128 :1+2+8 = 11 public int numSum(int num) { int sum = 0; do { sum += num % 10; } while ((num = num / 10) > 0); return sum;......

SongAlone
昨天
124
0
为什么图片反复压缩后普遍会变绿,而不是其他颜色?

作者:Lion Yang 链接:https://www.zhihu.com/question/29355920/answer/119088684 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 业余版概要:安卓的...

shzwork
昨天
71
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部