You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by anirbanroysap <an...@gmail.com> on 2013/09/29 19:57:24 UTC

Consuming camel twitter component

Hi, 

I am using camel-twitter component to consume twitter services. I am able to
to do it using java DSLs as given in the example(Camel twitter websocket
blueprint). But I have a requirement of configuring the camel routes in the
blueprint xml itself. 
I am not able to configure the camel component in the blueprint xml with the
accesToken,accesTokenSecret,Consumerkey and cosumerSecret. It has been shown
how to configure them while creating the endpoint itself. But I want to
configure them seprately in the blueprint xml so that my endpoint URL is
clean. Is it possible to do so. If yes, please share an example with me. 

Thanks and regards, 
Anirban



--
View this message in context: http://camel.465427.n5.nabble.com/Consuming-camel-twitter-component-tp5740432.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Consuming camel twitter component

Posted by Claus Ibsen <cl...@gmail.com>.
You can configure it the usual spring bean style also.

On Mon, Sep 30, 2013 at 1:02 PM, anirbanroysap <an...@gmail.com> wrote:
> Hi Claus,
>
> Does this mean that I can give the configuration parameters as a part of the
> endpoint URI ONLY?
>
> Thanks and regards,
> Anirban
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Consuming-camel-twitter-component-tp5740432p5740531.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

Re: Consuming camel twitter component

Posted by anirbanroysap <an...@gmail.com>.
Hi Claus,

Does this mean that I can give the configuration parameters as a part of the
endpoint URI ONLY?

Thanks and regards,
Anirban





--
View this message in context: http://camel.465427.n5.nabble.com/Consuming-camel-twitter-component-tp5740432p5740531.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Consuming camel twitter component

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Sep 30, 2013 at 10:15 AM, anirbanroysap <an...@gmail.com> wrote:
> Hi Claus,
>
> Yes I have seen the example.
> The twitter endpoint requires some configuration parameters like
> consumerKey,accesToken etc. to be set.
> If I understand correctly it can be set while creating the endpoint URL.
>
> So, can I declare my endpoint as
> <endpoint id="mytwitter"
> url="twitter://search?type=polling&amp;delay=5&amp;keywords=obama">
> <property name="consumerKey" value="XXXXXX"/>
> <property name="consumerSecret value="XXXXXX"/>
> <property name="accessToken" value="XXXXXX"/>
> <property name="accessTokenSecret" value="XXXXXX"/>
> </endpoint>
>

You cannot do this, as <endpoint> does not support <property>.
Though its a nice idea.


> And then use it in my route as:
> <to uri="mytwitter"/>
>
> Thanks and regards,
> Anirban
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Consuming-camel-twitter-component-tp5740432p5740462.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

Re: Consuming camel twitter component

Posted by anirbanroysap <an...@gmail.com>.
Hi Claus,

Yes I have seen the example. 
The twitter endpoint requires some configuration parameters like
consumerKey,accesToken etc. to be set.
If I understand correctly it can be set while creating the endpoint URL.

So, can I declare my endpoint as
<endpoint id="mytwitter"
url="twitter://search?type=polling&amp;delay=5&amp;keywords=obama">
<property name="consumerKey" value="XXXXXX"/>
<property name="consumerSecret value="XXXXXX"/>
<property name="accessToken" value="XXXXXX"/>
<property name="accessTokenSecret" value="XXXXXX"/>
</endpoint>

And then use it in my route as:
<to uri="mytwitter"/>

Thanks and regards,
Anirban





--
View this message in context: http://camel.465427.n5.nabble.com/Consuming-camel-twitter-component-tp5740432p5740462.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Consuming camel twitter component

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Have you seen the camel-example-twitter-websocket-blueprint ?

And you can define endpoints as <endpoint id="foo" url="...">

And then refer to the endpoints in your route to have clean and logical uris

<from uri="foo"/>

Or use ref: so the reader can see it refers to the <endpoint>
<from uri="ref:foo"/>




On Sun, Sep 29, 2013 at 7:57 PM, anirbanroysap <an...@gmail.com> wrote:
> Hi,
>
> I am using camel-twitter component to consume twitter services. I am able to
> to do it using java DSLs as given in the example(Camel twitter websocket
> blueprint). But I have a requirement of configuring the camel routes in the
> blueprint xml itself.
> I am not able to configure the camel component in the blueprint xml with the
> accesToken,accesTokenSecret,Consumerkey and cosumerSecret. It has been shown
> how to configure them while creating the endpoint itself. But I want to
> configure them seprately in the blueprint xml so that my endpoint URL is
> clean. Is it possible to do so. If yes, please share an example with me.
>
> Thanks and regards,
> Anirban
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Consuming-camel-twitter-component-tp5740432.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