image.png

  1. Messages are the entities used by systems to communicate with each other when using messaging channels.
  2. Messages flow in one direction from a sender to a receiver, as illustrated in figure 1.3.

消息是系统在使用消息传递通道时用来相互通信的实体。
消息从发送方流向接收方,如图1.3所示。

image.png

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

消息有一个主体(有效负载)、头和可选附件,如图1.4所示。

Messages are uniquely identified with an identifier of type java.lang.String. The identifier’s uniqueness is enforced  and guaranteed by the message creator, it’s protocol dependent, and it doesn’t have a guaranteed format. For protocols  that don’t define a unique message identification scheme,  Camel uses its own UID generator.

消息由类型的标识符唯一标识java.lang.String. 标识符的唯一性由消息创建者强制和保证,它依赖于协议,并且没有保证的格式。对于没有定义唯一消息标识方案的协议,Camel使用自己的UID生成器。

### HEADERS AND ATTACHMENTS
Headers are values associated with the message, such as sender  identifiers, hints about content encoding, authentication information, and so on. Headers are name-value pairs; the name is a  unique, case-insensitive string, and the value is of type java.  lang.Object. This means that Camel imposes no constraints on  the type of the headers. Headers are stored as a map within the  message. A message can also have optional attachments, which  are typically used for the web service and email components.

标题和附件

标头是与消息相关联的值,例如发送方标识符、有关内容编码的提示、身份验证信息等。头是名称-值对;名称是唯一的、不区分大小写的字符串,值的类型是java对象. 这意味着Camel不会对头的类型施加任何约束。消息头作为映射存储在消息中。消息还可以具有可选附件,这些附件通常用于web服务和电子邮件组件。

### BODY
The body is of type java.lang.Object. That means that a message can store any kind  of content. 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 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.

消息体

消息体属于java.lang.Object对象. 这意味着消息可以存储任何类型的内容。这也意味着由应用程序设计者来确保接收者能够理解消息的内容。当发送方和接收方使用不同的正文格式时,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.

故障标志

消息也有一个错误标志。一些协议和规范(如WSDL和JBI)区分输出消息和故障消息。它们都是对调用操作的有效响应,但后者表示一个不成功的结果。一般来说,集成基础设施不会处理故障。它们是客户机和服务器之间契约的一部分,在应用程序级别进行处理。在路由过程中,消息包含在exchange中。