71.4.


${leftValue} OP rightValue

注意

Operator描述

==

=~

>

>=

<

!=

!=~

contains

!contains

~~

!~~

regex

!regex

in

!in

is

!is

range

!range

startsWith

endsWith

Operator描述

++

 — 

\n

\t

\r

\}

Operator描述

&&

  
 

${leftValue} OP rightValue && ${leftValue} OP rightValue

${leftValue} OP rightValue || ${leftValue} OP rightValue

// exact equals match
simple("${header.foo} == 'foo'")

// ignore case when comparing, so if the header has value FOO this will match
simple("${header.foo} =~ 'foo'")

// here Camel will type convert '100' into the type of header.bar and if it is an Integer '100' will also be converter to an Integer
simple("${header.bar} == '100'")

simple("${header.bar} == 100")

// 100 will be converter to the type of header.bar so we can do > comparison
simple("${header.bar} > 100")

71.4.1. 

simple("100 < ${header.bar}")

// testing for null
simple("${header.baz} == null")

// testing for not null
simple("${header.baz} != null")

simple("${header.date} == ${date:now:yyyyMMdd}")

simple("${header.type} == ${bean:orderService?method=getOrderType}")

simple("${header.title} contains 'Camel'")

simple("${header.number} regex '\\d{4}'")

simple("${header.type} in 'gold,silver'")

simple("${header.type} !in 'gold,silver'")

simple("${header.type} is 'java.lang.String'")

simple("${header.type} is 'String'")

simple("${header.number} range 100..199")

simple("${header.number} range '100..199'")

<from uri="seda:orders">
   <filter>
       <simple>${header.type} == 'widget'</simple>
       <to uri="bean:orderService?method=handleWidget"/>
   </filter>
</from>
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.