76.3. Example
from("queue:foo")
.filter().xquery("//foo")
.to("queue:bar")
from("direct:start")
.recipientList().xquery("concat('mock:foo.', /person/@city)", String.class);
<route>
<from uri="direct:start"/>
<recipientList>
<xquery type="java.lang.String">concat('mock:foo.', /person/@city</xquery>
</recipientList>
</route>
76.3.1. 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Namespaces ns = new Namespaces("c", "http://acme.com/cheese");
from("direct:start")
.filter().xquery("/c:person[@name='James']", ns)
.to("mock:result");
/c:person[@name='James']
Namespaces ns = new Namespaces("c", "http://acme.com/cheese")
.add("w", "http://acme.com/wine")
.add("b", "http://acme.com/beer");
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:foo="http://example.com/person"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="activemq:MyQueue"/>
<filter>
<xquery>/foo:person[@name='James']</xquery>
<to uri="mqseries:SomeOtherQueue"/>
</filter>
</route>
</camelContext>
</beans>