content based routing based on header value
2013-06-08 16:26
363 查看
http://camel.465427.n5.nabble.com/content-based-routing-based-on-header-value-td2449988.html
On Tue, Aug 10, 2010 at 5:42 PM, Mark Webb <[hidden email]> wrote:
> I am setting up a route in XML and want to send messages to a
> destination based on a field in the header. I have the following:
>
> <log message="Analyzed [${body}] with destination --> ${header.dest}"/>
> <choice>
> <when>
> <header>'${header.dest}' = 'stuff'</header>
> <to uri="jms:somewhere" />
> </when>
> </choice>
>
> As I test this the log gives me the correct information for
> ${header.dest} and that being "stuff", but I do not know how to test
> the value in order to send the message to the proper location. What
> is the proper syntax here? I looked through the Camel in Action book
> and the camel website and cannot find anything.
>
...[show rest of quote]
The <header> will only grab a header. It's not a scripting language to
evaluate expressions/predicates etc.
For that you can use any of the more powerful languages
http://camel.apache.org/languages.html
For example you can use the built in simple language
http://camel.apache.org/simple.html
Which is being explained in the appendix A of the Camel book (avail in
next MEAP update).
<simple>${header.dest} == 'stuff'</simple>
> Thanks,
> Mark
>
==================
在使用simple前不要调用 exchange.getOut(), 否则会导致in.header中的缺失
On Tue, Aug 10, 2010 at 5:42 PM, Mark Webb <[hidden email]> wrote:
> I am setting up a route in XML and want to send messages to a
> destination based on a field in the header. I have the following:
>
> <log message="Analyzed [${body}] with destination --> ${header.dest}"/>
> <choice>
> <when>
> <header>'${header.dest}' = 'stuff'</header>
> <to uri="jms:somewhere" />
> </when>
> </choice>
>
> As I test this the log gives me the correct information for
> ${header.dest} and that being "stuff", but I do not know how to test
> the value in order to send the message to the proper location. What
> is the proper syntax here? I looked through the Camel in Action book
> and the camel website and cannot find anything.
>
...[show rest of quote]
The <header> will only grab a header. It's not a scripting language to
evaluate expressions/predicates etc.
For that you can use any of the more powerful languages
http://camel.apache.org/languages.html
For example you can use the built in simple language
http://camel.apache.org/simple.html
Which is being explained in the appendix A of the Camel book (avail in
next MEAP update).
<simple>${header.dest} == 'stuff'</simple>
> Thanks,
> Mark
>
==================
在使用simple前不要调用 exchange.getOut(), 否则会导致in.header中的缺失
相关文章推荐
- How to hide and show elements based on a Content Control value change?
- [React Intl] Render Content Based on a Number using react-intl FormattedMessage (plural)
- use a data or computed property based on the prop's value.
- Get the F4 help of a field based on the value of another field in the selction screen(联动的搜索帮助)
- jboss esb基于Drools的Content Based Routing
- Mule ESB-Content-Based Routing Tutorial(1)
- TreapDB is a key-value store based on Treap
- Mule ESB-Content-Based Routing Tutorial(2)
- Conditional row color based on a cell value
- sorting data based on the value in second column of a file
- CHANGING BEHAVIOR BASED ON THE VALUE OF AN ENUMERATED TYPE(ZT)
- Troubleshooting routing topology based on a reference topology
- Mule ESB-Content-Based Routing Tutorial(3)
- Mule ESB-Content-Based Routing Tutorial(3)
- Content Based Routing Web Services in .NET and J2EE
- NECTAR:A DTN Routing Protocol Based on Neighborhood Contact History
- Video captioning with recurrent networks based on frame- and video-level features and visual content
- A Web-based Rich Content Editor that works on Opera
- Filtering F4 Help Values in Table Control, Based On Other Field Value
- REST in WCF: Varying response content type based on HTTP Request Headers