добавление параметров после параметров запроса Apache Camel Spring DSL - PullRequest
0 голосов
/ 25 февраля 2019

Я пытаюсь сделать запрос на получение следующего URL:

http://hellostackexchange? Mynameiskees.json

проблема в том, что я не вижукак я могу добавить параметры опции после того, как я добавил параметры запроса в 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&amp;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&amp;authPassword=kees"/>
    <to uri="log:result"/>
  </route>
</camelContext>

это приводит к ошибке:

There are 2 parameters that couldn't be set on the endpoint. Check the uri 
if the parameters are spelt correctly and that they are properties of the 
endpoint. Unknown parameters=[{authPassword=kees, authUsername=kees}]

какие-либо советы о том, как это сделать?

1 Ответ

0 голосов
/ 04 марта 2019

С помощью @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&amp;period=1000" />
       <setHeader headerName="CamelHttpQuery">
           <simple>"mynameiskees.json"</simple>
       </setHeader>
       <to uri="http4://hellostackexchange?authUsername=kees&amp;authPassword=kees"/>
       <to uri = "log:result"/>
   </route>
</camelContext>
...