Shanghai Blog Posts 博客
发表博客,分享产品知识,技能,心得体会
cancel
Showing results for 
Search instead for 
Did you mean: 
Song
Explorer
0 Kudos

Cloud Integration支持 在 Camel 简单表达式语言中定义的表达式

配置以下组件时,可以使用 Camel 简单表达式语言:

支持 Camel 简单表达式语言的组件元件 使用骆驼简单表达式 更多信息

内容修饰符

定义:
  • 邮件正文

  • 邮件头

  • 交换属性

(类型参数设置为表达式)

定义内容修饰符

写入变量定义一个变量。

(类型参数设置为表达式)

定义写入变量

路由器定义路由条件。

(表达式类型参数设置为非 XML)

定义路由器

内容过滤器

定义 XPath 元素的条件。

若要查看一些示例,请参阅示例

定义过滤器

表达式示例

exchangeId

Exchange Id.

${exchangeId}

id

Message Id

${id}

body

Incoming message body

${body}

in.body

Incoming message body

${in.body}

This expression is deprecated from Apache Camel version 3.12.x.

bodyAs(<class>

Message body converted to compatible class

${bodyAs(String)}

mandatoryBodyAs(<class>)

Message body is Mandatory converted to compatible class

${mandatoryBodyAs(String)}

in.header.fo

Refers to foo (forward declaration) in header

${in.header.mandatory.length}

in.header.foo.OGNL

Refers to foo (forward declaration) in header with OGNL (Object-Graph Navigation Language) expresssion

${in.header.fname.split(',')[0]}

headerAs(<key>,<class>

Refers to header with name converted to compatible class<key>

${headerAs(name, String)}

property.foo

Refers to foo (forward declaration) in exchange property

${property.token.length}

property.foo.OGNL

Refers to foo (forward declaration) in exchange property with OGNL (Object-Graph Navigation Language) expresssion

${property.token.split(',')[0]}

sys.foo

Refers to foo (forward declaration) in system (runtime container)

${sys.file.separator}

sysenv.foo

Refers to foo (forward declaration) in system enviroment

${sysenv.property1}

date:<command>:<pattern>

Creates date specified in command and uses notationSimpleDateFormat

Processed at ${date:now-2h}

Othe rexample: To write the current timestamp into a message header, define a header with the following value (and Type set to Expression😞

${date:now:yyyy-MM-dd HH:mm:ss}

date-with-timezone:<command>:<timezone>:<pattern>

Same as , but with timezonedate

Expires at ${date-with-timezone:now+2h30m:IST:yyyy-MM-dd'T'HH:mm:ss.SSSZ}

 

Song_0-1696993290246.png