query Hi Alex,
perhaps I can shed some light on this, the header in header filter
strategy refers to Camel message headers and external (say HTTP)
headers. I think (haven't looked at the code) that the query
parameters are put in the message headers and it seems that the path
parameters are not. I know it's a bit inconsistent and confusing, I
think it's also different from how the HTTP producer (client)
components, or at least the ones created from RestProducerFactory
work, as far as I remember, both query and path parameters are taken
from Camel message headers.

I think you want to create your own HttpBinding to finely tune this
behaviour. I do think Camel would benefit from improving in this area
and we could certainly make this a bit clearer and straightforward to
use.

zoran

On Fri, Feb 7, 2020 at 4:00 PM Alex Soto <alex.s...@envieta.com> wrote:
>
> The other inconsistence is that path parameters defined in the Rest DSL are 
> copied to Exchange headers without any issue, i.e., unaffected by the header 
> filter strategy.  So we end up with:
>
> Path parameters unaffected by header filter.
> Query parameters affected by header filter.
>
> I would think both should behave the same way, preferable not being affected 
> by the header filter strategy.
>
>
> Best regards,
> Alex soto
>
>
>
>
> > On Feb 6, 2020, at 4:44 PM, Alex Soto <alex.s...@envieta.com> wrote:
> >
> > Look like it is caused by my:
> >
> >       <endpointProperty key="headerFilterStrategy" value="#headerFilter" />
> >
> > Which is very strange, since the ones that have default value are not being 
> > filtered.
> >
> > However my intention (when using the header filter strategy) is to filter 
> > incoming HTTP request headers,  not to the headers that are copied from the 
> > query parameters, since this is done by Camel and it is still useful.   Is 
> > there a way to control this?
> >
> >
> > Best regards,
> > Alex soto
> >
> >
> >
> >
> >> On Feb 6, 2020, at 3:34 PM, Alex Soto <alex.s...@envieta.com 
> >> <mailto:alex.s...@envieta.com>> wrote:
> >>
> >> Hello:
> >>
> >> Running Camel 3.0.1.  I have a Rest DSL, where Query Params are not being 
> >> copied to the Exchange
> >>
> >>              <rest path="executions">
> >>                      <get>
> >>                              <param name="dataSchemaId" type="query" 
> >> dataType="int" required="false"/>
> >>                              <param name="dataSourceId" type="query" 
> >> dataType="int" required="false"/>
> >>                              <param name="incomplete" type="query" 
> >> dataType="boolean" required="false" defaultValue="false"/>
> >>                              <param name="pending" type="query" 
> >> dataType="boolean" required="false" defaultValue="false"/>
> >>                              <param name="running" type="query" 
> >> dataType="boolean" required="false" defaultValue="false"/>
> >>                              <param name="failed" type="query" 
> >> dataType="boolean" required="false" defaultValue="false"/>
> >>                              <param name="offline" type="query" 
> >> dataType="boolean" required="false" defaultValue="false"/>
> >>                              <param name="startIndex" type="query" 
> >> dataType="int" required="false"/>
> >>                              <param name="maxResult" type="query" 
> >> dataType="int" required="false"/>
> >>                              <param name="ascendingSortOrder" type="query" 
> >> dataType="boolean" required="false" defaultValue="false"/>
> >>
> >>                              <to uri="direct:list-executions"/>
> >>                      </get>
> >>              </rest>
> >>
> >>
> >> When I send a GET request to  executions?dataSchemaId=100    the exchange 
> >> parameters do not include the dataSchemaId parameter, but it does contain 
> >> all the other params that have a default value.  The Rest DSL is 
> >> configured to use Servlet component.  The documentation 
> >> https://camel.apache.org/manual/latest/rest-dsl.html 
> >> <https://camel.apache.org/manual/latest/rest-dsl.html> seems to imply that 
> >> the query parameters are copied to the Exchange headers, but this is not 
> >> happening.  Any idea?
> >>
> >>
> >> Best regards,
> >> Alex soto
> >>
> >>
> >>
> >>
> >
>


-- 
Zoran Regvart

Reply via email to