camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <ch0...@gmail.com>
Subject Re: Simple and easy REST client with Camel
Date Mon, 27 Oct 2014 09:48:52 GMT
Hi Jonathan,

Our documentation is not longer up to date as now the http component
proposes / provides also a HttpConsumer (= Polling Consumer) which is able
every x second to do a HTTP request. So, you can also use this syntax
within your Apache Camel route (from("http://").to("") to poll a HTTP
Server.

Regards,

On Mon, Oct 27, 2014 at 9:48 AM, Jonathan Vila Lopez <
jonathan.vila@gmail.com> wrote:

> Hello Charles
>
> But, with that code I used I successfully get the response and
> successfully unmarshals it...... in fact, in my code my problem was in the
> line of setBody.... I can not get the attributes.
>
> Anyway I will try your proposal.
>
> Kind regards.
>
>
> [image: Inline image 2]
>
> * Jonathan Vila    ** <https://www.twitter.com/jonathan_vila>
> <http://www.linkedin.com/in/jonathanvila>*
>
>
> * jonathan.vila@gmail.com <jonathan.vila@gmail.com>*
>
>
>
>
> On Mon, Oct 27, 2014 at 8:57 AM, Charles Moulliard <ch007m@gmail.com>
> wrote:
>
>> Hi Jonathan,
>>
>> To call the HTTP Server exposing the REST service the HTTP producer must
>> be
>> used and not the HTTP Consumer component of Camel (
>> http://camel.apache.org/http.html). This syntax is not correct
>> (from("http://") while this one is correct
>>
>> from("direct:marvel").to("
>>
>> http://gateway.marvel.com:80/v1/public/comics?dateDescriptor=nextWeek&ts=987&apikey=97f295907072a970c5df30d73d1f3816&hash=abfa1c1d42a73a5eab042242335d805d
>> ").
>>       unmarshal().json(JsonLibrary.Jackson).
>>       setBody(simple("my attributes are : ${body?.code?}")).
>>       to("stream:out");
>>
>> Regards,
>>
>
>


-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

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