Apache camel 在查询参数之后添加选项apache camel spring DSL
我正在尝试对以下url执行get请求: 问题是,在将查询参数添加到uri之后,我不知道如何添加选项参数。我的尝试如下:Apache camel 在查询参数之后添加选项apache camel spring DSL,apache-camel,apache-servicemix,Apache Camel,Apache Servicemix,我正在尝试对以下url执行get请求: 问题是,在将查询参数添加到uri之后,我不知道如何添加选项参数。我的尝试如下: <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> &l
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="hello stackexchange">
<from uri="timer://counting_camera?fixedRate=true&period=1000" />
<setHeader headerName="CamelHttpQuery">
<simple>"mynameiskees.json"</simple>
</setHeader>
<to uri=http4://hellostackexchange/>
<to uri = "direct:test"/>
</route>
<route id = "final">
<from uri="direct:test?authUsername=kees&authPassword=kees"/>
<to uri="log:result"/>
</route>
</camelContext>
关于如何做到这一点的任何提示?在@Namphibian的帮助下,我做了以下工作,您只需将查询参数添加到标题中,并将选项添加到uri中即可:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="hello stackexchange">
<from uri="timer://counting_camera?fixedRate=true&period=1000" />
<setHeader headerName="CamelHttpQuery">
<simple>"mynameiskees.json"</simple>
</setHeader>
<to uri="http4://hellostackexchange?authUsername=kees&authPassword=kees"/>
<to uri = "log:result"/>
</route>
</camelContext>
“mynameiskees.json”
在@Namphibian的帮助下,我做了以下工作,您只需将查询参数添加到标题中,并将选项添加到uri中即可:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="hello stackexchange">
<from uri="timer://counting_camera?fixedRate=true&period=1000" />
<setHeader headerName="CamelHttpQuery">
<simple>"mynameiskees.json"</simple>
</setHeader>
<to uri="http4://hellostackexchange?authUsername=kees&authPassword=kees"/>
<to uri = "log:result"/>
</route>
</camelContext>
“mynameiskees.json”
Direct没有这些参数。您可以将它们放在邮件头中,或将它们添加为邮件/交换的属性。多亏了这条评论,我才解决了这个问题。谢谢:DDirect没有这些参数。您可以将它们放在邮件头中,或将它们添加为邮件/交换的属性