文档章节

Camel概念【Message】

k_k_anna
 k_k_anna
发布于 2015/01/27 17:19
字数 609
阅读 77
收藏 1

此为message的功能

Messages are the entities used by systems to communicate with each other when using

messaging channels. (message是系统在信道间通信的实体)

Messages flow in one direction from a sender to a receiver, as illustrated in figure 1.3.

此为message的结构

Messages have a body (a payload),headers, and optional attachments, as illustrated in figure 1.4.


 

此为message的特点

1)Messages are uniquely identified with an identifier of type java.lang.String

2)The identifier’s uniqueness is enforced and guaranteed by the message creator, 

3)It’s protocol dependent, and it doesn’t have a guaranteed format.

4) For protocols that don’t define a unique message identification scheme, Camel uses its own  UID generator.

HEADERS AND ATTACHMENTS


Headers are values associated with the message, such as sender identifiers, hints about content encoding,authentication information, and so on. (header与Message相关联的值有:发送者的标识符、内容编码提示、认证信息等)

Headers are name-value pairs; the name is a unique, case-insensitive string, and the value is of type  java.lang.Object .(headers 是键值对的组合,键(name)是不区分大小写的唯一字串,值(value)是java对象)

 This means that Camel imposes no constraints on the type of the headers. (header的类型是没有限制的)

Headers are stored as a map within the message.(header作为map存储)

 A message can also have optional attachments(附件), which are typically used for the web service and email components.


BODY

The body is of type  java.lang.Object . That means that a message can store any kind of content. (body也是一种java对象,这意味着message可以以任何形式储存)

It also means that it’s up to the application designer to make sure that the receiver can understand the content of the message. When the sender and receiveruse different body formats, Camel provides a number of mechanisms to transform the data into an acceptable format, and in many cases the conversion happens automati-cally with type converters, behind the scenes.(这也意味着,应用设计者要确保当传送方以不同格式传送message时,接收方可以理解message的内容,camel给出了很多传输转换机制确保数据是可接受的格式,在很多条件下,转换机制将在框架内部实现自动转换)

FAULT FLAG

Messages also have a fault flag. Some protocols and specifications, such as  WSDL and

JBI , distinguish between output and fault messages. They’re both valid responses to

invoking an operation, but the latter indicates an unsuccessful outcome. In general,

faults aren’t handled by the integration infrastructure. They’re part of the contract

between the client and the server and are handled at the application level.(注意错误的级别)

During routing, messages are contained in an exchange.(messages 包含在Exchange当中)


© 著作权归作者所有

k_k_anna
粉丝 13
博文 52
码字总数 3024
作品 0
海淀
程序员
私信 提问
加载中

评论(0)

Camel概念【Exchange 】

Exchange An exchange in Camel is the message’s container during routing. (在camel中,exchange被当做路由交换的容器) An exchange also provides support for the various types of......

k_k_anna
2015/01/27
426
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简介与入门

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

王振威
2012/09/23
4.8W
15
Apache Camel 2.6.0 发布

Apache Camel 是一个非常强大的基于规则的路由以及媒介引擎,该引擎提供了一个基于POJO的 企业应用模式(Enterprise Integration Patterns)的实现,你可以采用其异常强大且十分易用的API (可以...

红薯
2011/01/31
703
1
Camel整合问题

Camel这东西好像不是太灵活! 比如camel和mina的整合,camel使用自己的api包装了mina的api,业务逻辑层也做了封装。mina components 内部的iohandler,只实现了mina的messageReceived(把收到...

王全
2009/11/25
1.6K
2

没有更多内容

加载失败,请刷新页面

加载更多

开源商城开发笔记4-配置MyBatis生成代码

本项目基于SpringBoot开发,引入的是mybatis-spring-boot 1、引入依赖,包括spring-boot,mybatis,druid,junit,log4j 2.配置MyBatis-Generator插件,使用Maven插件的方式生成代码 3.配置M...

土龙
46分钟前
69
0
Java深拷贝和浅拷贝

对象拷贝有哪些 对象拷贝(Object Copy)就是将一个对象的属性拷贝到另一个有着相同类类型的对象中去。在程序中拷贝对象是很常见的,主要是为了在新的上下文环境中复用对象的部分或全部数据。 ...

Onegoleya
49分钟前
70
0
Android Binder机制 - interface_cast和asBinder讲解

研究Android底层代码时,尤其是Binder跨进程通信时,经常会发现interface_cast和asBinder,很容易被这两个函数绕晕,下面来讲解一下: interface_cast 下面根据下述ICameraClient例子进行分析...

天王盖地虎626
今天
72
0
Java @Deprecated Annotation(注解)

在本部分的快速指南中,我们将会查看 Java 的 deprecated API 和如何在程序中使用 @Deprecated 注解。 @Deprecated Annotation(注解) 作为程序的进化和迭代,随着时间的推移,在项目中总会...

honeymoose
今天
94
0
OSChina 周四乱弹 —— 失业后的阳光太刺眼了

Osc乱弹歌单(2020)请戳(这里) 【今日歌曲】 @大又 :分享Jack Stauber的单曲《Fighter》 《Fighter》- Jack Stauber 手机党少年们想听歌,请使劲儿戳(这里) @theLovelyBugfly :笑死我...

小小编辑
今天
1.3K
9

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部