camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John D. Ament" <johndam...@apache.org>
Subject Re: Not seeing query params on REST DSL
Date Mon, 25 Apr 2016 17:52:11 GMT
Apologies as I missed this.

As far as I know, you need to explicitly register your query params.  They
are not automatically propagated.

John

On Mon, Apr 25, 2016 at 1:33 PM Steve Huston <shuston@riverace.com> wrote:

> On the risk of aggravating people (sorry) popping this up to today's
> content... any help is most welcome.
>
> Thanks!
> -Steve
>
> > -----Original Message-----
> > From: Steve Huston
> > Sent: Wednesday, April 20, 2016 8:57 PM
> > To: users@camel.apache.org
> > Subject: Re: Not seeing query params on REST DSL
> >
> > I am using Camel 2.16.3 and restlet.
> >
> > -Steve
> >
> > > On Apr 20, 2016, at 7:27 PM, John D. Ament <johndament@apache.org>
> > wrote:
> > >
> > > Steve
> > >
> > > Could you share your dependencies as well?  Which rest runtime are you
> > > using?
> > > On Apr 20, 2016 17:12, "Steve Huston" <shuston@riverace.com> wrote:
> > >
> > >> I am using the REST DSL in a Camel SCR unit test. I have a route
> > >> (being
> > >> tested) that will initiate a http request at this URL:
> > >>
> > >>        @Test
> > >>        public void testRoutes() throws Exception {
> > >>        context.addRoutes(new RouteBuilder() {
> > >>                @Override
> > >>                public void configure() throws Exception {
> > >>
> > >> restConfiguration().component("restlet").port(9000);
> > >>                        rest("/asset")
> > >>                                .put("/{addr}/pong")
> > >> .param().name("id").type(RestParamType.query).endParam()
> > >>                                .to("log:steve?showAll=true")
> > >>                                .to("mock:result");
> > >>                }
> > >>        });
> > >>
> > >>        MockEndpoint resultEndpoint =
> > >> context.getEndpoint("mock:result",
> > >> MockEndpoint.class);
> > >>        resultEndpoint.expectedMessageCount(1);
> > >>
> > >> resultEndpoint.message(0).header("addr").isEqualTo("my_test_value");
> > >>        resultEndpoint.message(0).header("id").isEqualTo("abcd1234");
> > >>
> > >>
> > >> At run time, the request does arrive as a PUT to
> > >> http://127.0.0.1:9000/asset/my_test_value/pong?id=abcd1234
> > >>
> > >> However, I am only getting the "addr" path parameter in the header.
> > >> The query param "id" is missing.
> > >> Am I doing something wrong on the definition? I pieced together the
> > >> way to do it from disparate tidbits on the net.
> > >>
> > >> Thanks,
> > >> -Steve
> > >>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message