You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by muell01 <ro...@hp.com> on 2015/01/28 19:32:23 UTC
HTTP consumer - Terminology confusing
I use the following as a REST consumer from an external service. I know the
warning in the Camel docs... but am I using this a webservice consumer or as
a Rest Client.
Is this form proper? If not what would I replace it with?
Would someone explain what the ramifications are in using HTTP as a
consumer. (I know the warnings are dire, but why?)
<from
uri="http://api.application.com/v1/pull?id={{streamId}}&api_key={{api_key}}&username={{username}}"/>
Rob
--
View this message in context: http://camel.465427.n5.nabble.com/HTTP-consumer-Terminology-confusing-tp5762190.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: HTTP consumer - Terminology confusing
Posted by muell01 <ro...@hp.com>.
thank you. Glad to know the config is good.
The polling consumer is what we intended.
camel 2.12/activemq 5.9 (we love the Hawtio), war file deployed onto EAP6.3
The original reason for this post is because the client will stall w/o
warnings. No polling activity. no warnings or errors. Sometimes the route
can be stopped/restarted (which we do with a separate route that uses the
controllbus) and sometimes we have to undeploy/deploy. I know, it sounds
like memory issues or too many threads, but the JVM stats show this is not
the case. We're still investigating.
So the warnings in the docs had me concerned. (maybe they should be removed
for us w/limited experience to camel and are basically rule followers)
Code snippet:
<from
uri="http://api.application.com/v1/pull?id={{stream}}&api_key={{api_key}}&username={{username}}"/>
<choice>
<when>
<simple>${header.CamelHttpResponseCode} == "200"</simple>
<convertBodyTo type="java.lang.String"/>
<to uri="activemq:queue:preQ"/>
...
But why does the camel doc. say not to use HTTP as consumer to the route? I
understand Clause's suggestion of the Timer to manage the poll. But w/the
timer it is invoked whether the route is complete or not. In our situation,
we suppress this multi threaded behaviour.
Thanks
Rob
--
View this message in context: http://camel.465427.n5.nabble.com/HTTP-consumer-Terminology-confusing-tp5762190p5762234.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: HTTP consumer - Terminology confusing
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
It will poll this in an endless loop, its better to use a timer to
schedule how often to call the http service if you want to call it
repetitively.
from timer
to http
On Thu, Jan 29, 2015 at 4:45 AM, Willem Jiang <wi...@gmail.com> wrote:
> What kind of warning did you get?
> Using the HTTP component as a pulling consuming is OK from my point of view. It just pulling the result from url with the GET method.
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
> On January 29, 2015 at 9:57:29 AM, muell01 (rob.mueller2@hp.com) wrote:
>>
>> I use the following as a REST consumer from an external service. I know the
>> warning in the Camel docs... but am I using this a webservice consumer or as
>> a Rest Client.
>> Is this form proper? If not what would I replace it with?
>> Would someone explain what the ramifications are in using HTTP as a
>> consumer. (I know the warnings are dire, but why?)
>>
>> > uri="http://api.application.com/v1/pull?id={{streamId}}&api_key={{api_key}}&username={{username}}"/>
>>
>> Rob
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/HTTP-consumer-Terminology-confusing-tp5762190.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Re: HTTP consumer - Terminology confusing
Posted by Willem Jiang <wi...@gmail.com>.
What kind of warning did you get?
Using the HTTP component as a pulling consuming is OK from my point of view. It just pulling the result from url with the GET method.
--
Willem Jiang
Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On January 29, 2015 at 9:57:29 AM, muell01 (rob.mueller2@hp.com) wrote:
>
> I use the following as a REST consumer from an external service. I know the
> warning in the Camel docs... but am I using this a webservice consumer or as
> a Rest Client.
> Is this form proper? If not what would I replace it with?
> Would someone explain what the ramifications are in using HTTP as a
> consumer. (I know the warnings are dire, but why?)
>
> > uri="http://api.application.com/v1/pull?id={{streamId}}&api_key={{api_key}}&username={{username}}"/>
>
> Rob
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/HTTP-consumer-Terminology-confusing-tp5762190.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>