文档章节

Camel概念【Exchange 】

k_k_anna
 k_k_anna
发布于 2015/01/27 22:25
字数 552
阅读 435
收藏 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
海淀
程序员
私信 提问
加载中

评论(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
107
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.8K
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
611
0

没有更多内容

加载失败,请刷新页面

加载更多

你还在贴发票吗?区块链带你玩点不一样的

本文作者:HelloDeveloper 报销是不是你每个月最头疼的事情?除了贴一大堆票之外,还要等财务人员一张张审核、录入系统、统一打款。如果有差错,还会告诉你所有一切重新来过。 如果你是财务人...

百度开发者中心
2019/10/15
9
0
OSChina 周六乱弹 —— 代码创造人工生命

Osc乱弹歌单(2020)请戳(这里) 【今日歌曲】 @小小编辑推荐:《inner universe》 - ORIGA 《inner universe》 - ORIGA 手机党少年们想听歌,请使劲儿戳(这里) 当机器人具有意识的时候,...

小小编辑
33分钟前
9
1
怎么创建远程桌面连接

1、IIS7远程桌面 管理中文最新版是一款专业的远程桌面管理工具,更新了原09网络远程桌面管理,较之以前的版本,操作更加便捷,能够同时远程多台服务器,多台服务器间自由切换,完全无压力。I...

吹的心痒痒
今天
22
0
JSP中的MVC开发模式

原文链接:http://www.yiidian.com/jsp/jsp-mvc-model.html 1 什么是MVC模式 MVC,代表模型(Model),视图(View),控制器(Controller)。这是一种将业务逻辑,表现逻辑和数据分开的设计模...

ericxu1116
今天
20
0
作业调度哪种方式好,最终选了Quartz

随着云平台,大数据等的出现,用户或潜在访问者越来越想免费体验产品,特别是想申请系统(比如开虚拟机,启动docker等),可是系统硬件资源有限,那怎么才能让用户实际操作云平台资源呢,那就...

董广明
昨天
23
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部