You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jose Espinosa <jo...@revinate.com> on 2013/08/23 02:18:09 UTC

String to Endpoint

Hi,


I am writing a route that needs to fetch data from a webpage, the
source webpage depends of the input message.  My current
implementation uses "dynamicRouter" but the need of track multiple
calls (I just need to go to fetch the data once) is a big turn off.


Is there a way to make dynamic routes without using "dynamicRouter"?
Or a way to dynamically transform a single value to an endpoint?


Thanks,

Jose Espinosa

Re: String to Endpoint

Posted by Jose Espinosa <jo...@revinate.com>.
Thanks Tracy!! This is what I'm looking for.

Jose

On Fri, Aug 23, 2013 at 12:27 PM, Tracy Snell <ts...@gmail.com> wrote:
> Set the header:
>
> Exchange.HTTP_URI       String  URI to call. Will override existing URI set directly on the endpoint.
>
> http://camel.apache.org/http4.html
>
> As the above says, that'll override whatever address is in the .to. So .to("http4://nowhere.com") will be replaced by Exchange.HTTP_URI if it exists.
>
> On Aug 23, 2013, at 1:03 PM, Jose Espinosa <jo...@revinate.com> wrote:
>
>> They are http endpoints.  Headers will definitely do the job but I
>> haven't find a way to do it.
>>
>> On Thu, Aug 22, 2013 at 5:37 PM, Christian Posta
>> <ch...@gmail.com> wrote:
>>> What endpoint will you use to fetch the webpage? Might be able to use
>>> headers...
>>>
>>> On Thursday, August 22, 2013, Jose Espinosa wrote:
>>>
>>>> Hi,
>>>>
>>>>
>>>> I am writing a route that needs to fetch data from a webpage, the
>>>> source webpage depends of the input message.  My current
>>>> implementation uses "dynamicRouter" but the need of track multiple
>>>> calls (I just need to go to fetch the data once) is a big turn off.
>>>>
>>>>
>>>> Is there a way to make dynamic routes without using "dynamicRouter"?
>>>> Or a way to dynamically transform a single value to an endpoint?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Jose Espinosa
>>>>
>>>
>>>
>>> --
>>> *Christian Posta*
>>> http://www.christianposta.com/blog
>>> twitter: @christianposta
>

Re: String to Endpoint

Posted by Tracy Snell <ts...@gmail.com>.
Set the header:

Exchange.HTTP_URI	String	URI to call. Will override existing URI set directly on the endpoint.

http://camel.apache.org/http4.html

As the above says, that'll override whatever address is in the .to. So .to("http4://nowhere.com") will be replaced by Exchange.HTTP_URI if it exists.

On Aug 23, 2013, at 1:03 PM, Jose Espinosa <jo...@revinate.com> wrote:

> They are http endpoints.  Headers will definitely do the job but I
> haven't find a way to do it.
> 
> On Thu, Aug 22, 2013 at 5:37 PM, Christian Posta
> <ch...@gmail.com> wrote:
>> What endpoint will you use to fetch the webpage? Might be able to use
>> headers...
>> 
>> On Thursday, August 22, 2013, Jose Espinosa wrote:
>> 
>>> Hi,
>>> 
>>> 
>>> I am writing a route that needs to fetch data from a webpage, the
>>> source webpage depends of the input message.  My current
>>> implementation uses "dynamicRouter" but the need of track multiple
>>> calls (I just need to go to fetch the data once) is a big turn off.
>>> 
>>> 
>>> Is there a way to make dynamic routes without using "dynamicRouter"?
>>> Or a way to dynamically transform a single value to an endpoint?
>>> 
>>> 
>>> Thanks,
>>> 
>>> Jose Espinosa
>>> 
>> 
>> 
>> --
>> *Christian Posta*
>> http://www.christianposta.com/blog
>> twitter: @christianposta


Re: String to Endpoint

Posted by Jose Espinosa <jo...@revinate.com>.
They are http endpoints.  Headers will definitely do the job but I
haven't find a way to do it.

On Thu, Aug 22, 2013 at 5:37 PM, Christian Posta
<ch...@gmail.com> wrote:
> What endpoint will you use to fetch the webpage? Might be able to use
> headers...
>
> On Thursday, August 22, 2013, Jose Espinosa wrote:
>
>> Hi,
>>
>>
>> I am writing a route that needs to fetch data from a webpage, the
>> source webpage depends of the input message.  My current
>> implementation uses "dynamicRouter" but the need of track multiple
>> calls (I just need to go to fetch the data once) is a big turn off.
>>
>>
>> Is there a way to make dynamic routes without using "dynamicRouter"?
>> Or a way to dynamically transform a single value to an endpoint?
>>
>>
>> Thanks,
>>
>> Jose Espinosa
>>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta

Re: String to Endpoint

Posted by Christian Posta <ch...@gmail.com>.
What endpoint will you use to fetch the webpage? Might be able to use
headers...

On Thursday, August 22, 2013, Jose Espinosa wrote:

> Hi,
>
>
> I am writing a route that needs to fetch data from a webpage, the
> source webpage depends of the input message.  My current
> implementation uses "dynamicRouter" but the need of track multiple
> calls (I just need to go to fetch the data once) is a big turn off.
>
>
> Is there a way to make dynamic routes without using "dynamicRouter"?
> Or a way to dynamically transform a single value to an endpoint?
>
>
> Thanks,
>
> Jose Espinosa
>


-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta