Why is this not possible with the twitter component in Camel 2.10 ?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Why is this not possible with the twitter component in Camel 2.10 ?

soumya_sd
I'm trying to use Camel twitter component.
http://camel.apache.org/twitter.html

I want to create a route like -

                from("direct:twitter-search").to(
                                "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
                                .to("stream:out");




However, looks like this is not supported (see exception below). Can someone explain why?


org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling]. Reason: java.lang.IllegalArgumentException: Cannot create any producer with uri twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling. A producer type was not provided (or an incorrect pairing was used).

Given that twitter component internally makes use of HTTP REST calls it should be possible to use it both as a consumer as well as a producer.

For example, I can successfully execute the following route with the http component.  I cannot understand why I cannot do the same with the twitter component ?

from("direct:startgoogleplaces")
                                .process(new HTTPRequestParamProcessor())
                                .setHeader(
                                                Exchange.HTTP_QUERY,
                                                simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
                                .to("https://maps.googleapis.com/maps/api/place/search/json")
                                .unmarshal()
                                .json(JsonLibrary.Jackson, GooglePlaceResponseObject.class)
                                .log("before split the body is ${body}").to("stream:out);




Reply | Threaded
Open this post in threaded view
|

Re: Why is this not possible with the twitter component in Camel 2.10 ?

Claus Ibsen-2
Hi

I suggest to look at the unit tests to find samples how to do this.


On Fri, Jun 1, 2012 at 7:25 PM, soumya_sd <[hidden email]> wrote:

> I'm trying to use Camel twitter component.
> http://camel.apache.org/twitter.html
>
> I want to create a route like -
>
>                from("direct:twitter-search").to(
>
> "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
>                                .to("stream:out");
>
>
>
>
> However, looks like this is not supported (see exception below). Can someone
> explain why?
>
>
> *org.apache.camel.FailedToCreateProducerException: Failed to create Producer
> for endpoint:
> Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling].
> Reason: java.lang.IllegalArgumentException: Cannot create any producer with
> uri
> twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling.
> A producer type was not provided (or an incorrect pairing was used).*
>
> Given that twitter component internally makes use of HTTP REST calls it
> should be possible to use it both as a consumer as well as a producer.
>
> For example, I can successfully execute the following route with the http
> component.  I cannot understand why I cannot do the same with the twitter
> component ?
>
> from("direct:startgoogleplaces")
>                                .process(new HTTPRequestParamProcessor())
>                                .setHeader(
>                                                Exchange.HTTP_QUERY,
>
> simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
>                                .to("https://maps.googleapis.com/maps/api/place/search/json")
>                                .unmarshal()
>                                .json(JsonLibrary.Jackson, GooglePlaceResponseObject.class)
>                                .log("before split the body is ${body}").to("stream:out);
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
FuseSource
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Why is this not possible with the twitter component in Camel 2.10 ?

Christian Mueller
Administrator
In reply to this post by soumya_sd
"twitter://search" is only supported in the camel-twitter consumer ->
from("twitter://search?...")
Have a look at the source code or the unit tests...

Best,
Christian

On Fri, Jun 1, 2012 at 7:25 PM, soumya_sd <[hidden email]> wrote:

> I'm trying to use Camel twitter component.
> http://camel.apache.org/twitter.html
>
> I want to create a route like -
>
>                from("direct:twitter-search").to(
>
>
> "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
>                                .to("stream:out");
>
>
>
>
> However, looks like this is not supported (see exception below). Can
> someone
> explain why?
>
>
> *org.apache.camel.FailedToCreateProducerException: Failed to create
> Producer
> for endpoint:
>
> Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling].
> Reason: java.lang.IllegalArgumentException: Cannot create any producer with
> uri
>
> twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling.
> A producer type was not provided (or an incorrect pairing was used).*
>
> Given that twitter component internally makes use of HTTP REST calls it
> should be possible to use it both as a consumer as well as a producer.
>
> For example, I can successfully execute the following route with the http
> component.  I cannot understand why I cannot do the same with the twitter
> component ?
>
> from("direct:startgoogleplaces")
>                                .process(new HTTPRequestParamProcessor())
>                                .setHeader(
>                                                Exchange.HTTP_QUERY,
>
>
> simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
>                                .to("
> https://maps.googleapis.com/maps/api/place/search/json")
>                                .unmarshal()
>                                .json(JsonLibrary.Jackson,
> GooglePlaceResponseObject.class)
>                                .log("before split the body is
> ${body}").to("stream:out);
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Why is this not possible with the twitter component in Camel 2.10 ?

Bruno Borges
It's not difficult to let the SearchConsumer endpoint work as an
Event-driven too.

I'm going to work on this on a few weeks, but of course you can code your
own if you are in a hurry :-)

*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Sat, Jun 2, 2012 at 6:06 PM, Christian Müller <
[hidden email]> wrote:

> "twitter://search" is only supported in the camel-twitter consumer ->
> from("twitter://search?...")
> Have a look at the source code or the unit tests...
>
> Best,
> Christian
>
> On Fri, Jun 1, 2012 at 7:25 PM, soumya_sd <[hidden email]> wrote:
>
> > I'm trying to use Camel twitter component.
> > http://camel.apache.org/twitter.html
> >
> > I want to create a route like -
> >
> >                from("direct:twitter-search").to(
> >
> >
> >
> "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
> >                                .to("stream:out");
> >
> >
> >
> >
> > However, looks like this is not supported (see exception below). Can
> > someone
> > explain why?
> >
> >
> > *org.apache.camel.FailedToCreateProducerException: Failed to create
> > Producer
> > for endpoint:
> >
> >
> Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling].
> > Reason: java.lang.IllegalArgumentException: Cannot create any producer
> with
> > uri
> >
> >
> twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling.
> > A producer type was not provided (or an incorrect pairing was used).*
> >
> > Given that twitter component internally makes use of HTTP REST calls it
> > should be possible to use it both as a consumer as well as a producer.
> >
> > For example, I can successfully execute the following route with the http
> > component.  I cannot understand why I cannot do the same with the twitter
> > component ?
> >
> > from("direct:startgoogleplaces")
> >                                .process(new HTTPRequestParamProcessor())
> >                                .setHeader(
> >                                                Exchange.HTTP_QUERY,
> >
> >
> >
> simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
> >                                .to("
> > https://maps.googleapis.com/maps/api/place/search/json")
> >                                .unmarshal()
> >                                .json(JsonLibrary.Jackson,
> > GooglePlaceResponseObject.class)
> >                                .log("before split the body is
> > ${body}").to("stream:out);
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Why is this not possible with the twitter component in Camel 2.10 ?

Bruno Borges
Claus, what is the scheduled date for 2.10 to be released?


*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Thu, Jun 14, 2012 at 3:31 PM, Bruno Borges <[hidden email]>wrote:

> It's not difficult to let the SearchConsumer endpoint work as an
> Event-driven too.
>
> I'm going to work on this on a few weeks, but of course you can code your
> own if you are in a hurry :-)
>
> *Bruno Borges*
> (21) 7672-7099
> *www.brunoborges.com*
>
>
>
> On Sat, Jun 2, 2012 at 6:06 PM, Christian Müller <
> [hidden email]> wrote:
>
>> "twitter://search" is only supported in the camel-twitter consumer ->
>> from("twitter://search?...")
>> Have a look at the source code or the unit tests...
>>
>> Best,
>> Christian
>>
>> On Fri, Jun 1, 2012 at 7:25 PM, soumya_sd <[hidden email]> wrote:
>>
>> > I'm trying to use Camel twitter component.
>> > http://camel.apache.org/twitter.html
>> >
>> > I want to create a route like -
>> >
>> >                from("direct:twitter-search").to(
>> >
>> >
>> >
>> "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
>> >                                .to("stream:out");
>> >
>> >
>> >
>> >
>> > However, looks like this is not supported (see exception below). Can
>> > someone
>> > explain why?
>> >
>> >
>> > *org.apache.camel.FailedToCreateProducerException: Failed to create
>> > Producer
>> > for endpoint:
>> >
>> >
>> Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling].
>> > Reason: java.lang.IllegalArgumentException: Cannot create any producer
>> with
>> > uri
>> >
>> >
>> twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling.
>> > A producer type was not provided (or an incorrect pairing was used).*
>> >
>> > Given that twitter component internally makes use of HTTP REST calls it
>> > should be possible to use it both as a consumer as well as a producer.
>> >
>> > For example, I can successfully execute the following route with the
>> http
>> > component.  I cannot understand why I cannot do the same with the
>> twitter
>> > component ?
>> >
>> > from("direct:startgoogleplaces")
>> >                                .process(new HTTPRequestParamProcessor())
>> >                                .setHeader(
>> >                                                Exchange.HTTP_QUERY,
>> >
>> >
>> >
>> simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
>> >                                .to("
>> > https://maps.googleapis.com/maps/api/place/search/json")
>> >                                .unmarshal()
>> >                                .json(JsonLibrary.Jackson,
>> > GooglePlaceResponseObject.class)
>> >                                .log("before split the body is
>> > ${body}").to("stream:out);
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Why is this not possible with the twitter component in Camel 2.10 ?

Claus Ibsen-2
On Thu, Jun 14, 2012 at 8:33 PM, Bruno Borges <[hidden email]>wrote:

> Claus, what is the scheduled date for 2.10 to be released?
>
>
Soon, we want to release it this month.


>
> *Bruno Borges*
> (21) 7672-7099
> *www.brunoborges.com*
>
>
>
> On Thu, Jun 14, 2012 at 3:31 PM, Bruno Borges <[hidden email]
> >wrote:
>
> > It's not difficult to let the SearchConsumer endpoint work as an
> > Event-driven too.
> >
> > I'm going to work on this on a few weeks, but of course you can code your
> > own if you are in a hurry :-)
> >
> > *Bruno Borges*
> > (21) 7672-7099
> > *www.brunoborges.com*
> >
> >
> >
> > On Sat, Jun 2, 2012 at 6:06 PM, Christian Müller <
> > [hidden email]> wrote:
> >
> >> "twitter://search" is only supported in the camel-twitter consumer ->
> >> from("twitter://search?...")
> >> Have a look at the source code or the unit tests...
> >>
> >> Best,
> >> Christian
> >>
> >> On Fri, Jun 1, 2012 at 7:25 PM, soumya_sd <[hidden email]> wrote:
> >>
> >> > I'm trying to use Camel twitter component.
> >> > http://camel.apache.org/twitter.html
> >> >
> >> > I want to create a route like -
> >> >
> >> >                from("direct:twitter-search").to(
> >> >
> >> >
> >> >
> >>
> "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
> >> >                                .to("stream:out");
> >> >
> >> >
> >> >
> >> >
> >> > However, looks like this is not supported (see exception below). Can
> >> > someone
> >> > explain why?
> >> >
> >> >
> >> > *org.apache.camel.FailedToCreateProducerException: Failed to create
> >> > Producer
> >> > for endpoint:
> >> >
> >> >
> >>
> Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling].
> >> > Reason: java.lang.IllegalArgumentException: Cannot create any producer
> >> with
> >> > uri
> >> >
> >> >
> >>
> twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling.
> >> > A producer type was not provided (or an incorrect pairing was used).*
> >> >
> >> > Given that twitter component internally makes use of HTTP REST calls
> it
> >> > should be possible to use it both as a consumer as well as a producer.
> >> >
> >> > For example, I can successfully execute the following route with the
> >> http
> >> > component.  I cannot understand why I cannot do the same with the
> >> twitter
> >> > component ?
> >> >
> >> > from("direct:startgoogleplaces")
> >> >                                .process(new
> HTTPRequestParamProcessor())
> >> >                                .setHeader(
> >> >                                                Exchange.HTTP_QUERY,
> >> >
> >> >
> >> >
> >>
> simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
> >> >                                .to("
> >> > https://maps.googleapis.com/maps/api/place/search/json")
> >> >                                .unmarshal()
> >> >                                .json(JsonLibrary.Jackson,
> >> > GooglePlaceResponseObject.class)
> >> >                                .log("before split the body is
> >> > ${body}").to("stream:out);
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >> >
> >>
> http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
> >> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >> >
> >>
> >
> >
>



--
Claus Ibsen
-----------------
FuseSource
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Why is this not possible with the twitter component in Camel 2.10 ?

Bruno Borges
It seems I am http://www.youtube.com/watch?v=a01QQZyl-_I

:-D

*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Thu, Jun 14, 2012 at 3:39 PM, Claus Ibsen <[hidden email]> wrote:

> On Thu, Jun 14, 2012 at 8:33 PM, Bruno Borges <[hidden email]
> >wrote:
>
> > Claus, what is the scheduled date for 2.10 to be released?
> >
> >
> Soon, we want to release it this month.
>
>
> >
> > *Bruno Borges*
> > (21) 7672-7099
> > *www.brunoborges.com*
> >
> >
> >
> > On Thu, Jun 14, 2012 at 3:31 PM, Bruno Borges <[hidden email]
> > >wrote:
> >
> > > It's not difficult to let the SearchConsumer endpoint work as an
> > > Event-driven too.
> > >
> > > I'm going to work on this on a few weeks, but of course you can code
> your
> > > own if you are in a hurry :-)
> > >
> > > *Bruno Borges*
> > > (21) 7672-7099
> > > *www.brunoborges.com*
> > >
> > >
> > >
> > > On Sat, Jun 2, 2012 at 6:06 PM, Christian Müller <
> > > [hidden email]> wrote:
> > >
> > >> "twitter://search" is only supported in the camel-twitter consumer ->
> > >> from("twitter://search?...")
> > >> Have a look at the source code or the unit tests...
> > >>
> > >> Best,
> > >> Christian
> > >>
> > >> On Fri, Jun 1, 2012 at 7:25 PM, soumya_sd <[hidden email]>
> wrote:
> > >>
> > >> > I'm trying to use Camel twitter component.
> > >> > http://camel.apache.org/twitter.html
> > >> >
> > >> > I want to create a route like -
> > >> >
> > >> >                from("direct:twitter-search").to(
> > >> >
> > >> >
> > >> >
> > >>
> >
> "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
> > >> >                                .to("stream:out");
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > However, looks like this is not supported (see exception below). Can
> > >> > someone
> > >> > explain why?
> > >> >
> > >> >
> > >> > *org.apache.camel.FailedToCreateProducerException: Failed to create
> > >> > Producer
> > >> > for endpoint:
> > >> >
> > >> >
> > >>
> >
> Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling].
> > >> > Reason: java.lang.IllegalArgumentException: Cannot create any
> producer
> > >> with
> > >> > uri
> > >> >
> > >> >
> > >>
> >
> twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling.
> > >> > A producer type was not provided (or an incorrect pairing was
> used).*
> > >> >
> > >> > Given that twitter component internally makes use of HTTP REST calls
> > it
> > >> > should be possible to use it both as a consumer as well as a
> producer.
> > >> >
> > >> > For example, I can successfully execute the following route with the
> > >> http
> > >> > component.  I cannot understand why I cannot do the same with the
> > >> twitter
> > >> > component ?
> > >> >
> > >> > from("direct:startgoogleplaces")
> > >> >                                .process(new
> > HTTPRequestParamProcessor())
> > >> >                                .setHeader(
> > >> >                                                Exchange.HTTP_QUERY,
> > >> >
> > >> >
> > >> >
> > >>
> >
> simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
> > >> >                                .to("
> > >> > https://maps.googleapis.com/maps/api/place/search/json")
> > >> >                                .unmarshal()
> > >> >                                .json(JsonLibrary.Jackson,
> > >> > GooglePlaceResponseObject.class)
> > >> >                                .log("before split the body is
> > >> > ${body}").to("stream:out);
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > View this message in context:
> > >> >
> > >>
> >
> http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
> > >> > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >> >
> > >>
> > >
> > >
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>
Reply | Threaded
Open this post in threaded view
|

Re: Why is this not possible with the twitter component in Camel 2.10 ?

Bruno Borges
In reply to this post by soumya_sd
Soumya, please take a look at this new improvement here:

https://github.com/brunoborges/camel-twitter

I've forked 2.10-SNAPSHOT and added support for producing queries on the
fly like you asked. :-)




*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Fri, Jun 1, 2012 at 2:25 PM, soumya_sd <[hidden email]> wrote:

> I'm trying to use Camel twitter component.
> http://camel.apache.org/twitter.html
>
> I want to create a route like -
>
>                from("direct:twitter-search").to(
>
>
> "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
>                                .to("stream:out");
>
>
>
>
> However, looks like this is not supported (see exception below). Can
> someone
> explain why?
>
>
> *org.apache.camel.FailedToCreateProducerException: Failed to create
> Producer
> for endpoint:
>
> Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling].
> Reason: java.lang.IllegalArgumentException: Cannot create any producer with
> uri
>
> twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling.
> A producer type was not provided (or an incorrect pairing was used).*
>
> Given that twitter component internally makes use of HTTP REST calls it
> should be possible to use it both as a consumer as well as a producer.
>
> For example, I can successfully execute the following route with the http
> component.  I cannot understand why I cannot do the same with the twitter
> component ?
>
> from("direct:startgoogleplaces")
>                                .process(new HTTPRequestParamProcessor())
>                                .setHeader(
>                                                Exchange.HTTP_QUERY,
>
>
> simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
>                                .to("
> https://maps.googleapis.com/maps/api/place/search/json")
>                                .unmarshal()
>                                .json(JsonLibrary.Jackson,
> GooglePlaceResponseObject.class)
>                                .log("before split the body is
> ${body}").to("stream:out);
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Why is this not possible with the twitter component in Camel 2.10 ?

Bruno Borges
https://issues.apache.org/jira/browse/CAMEL-5374

THe patch has been submitted.

Thanks,
*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Mon, Jun 18, 2012 at 4:58 AM, Bruno Borges <[hidden email]>wrote:

> Soumya, please take a look at this new improvement here:
>
> https://github.com/brunoborges/camel-twitter
>
> I've forked 2.10-SNAPSHOT and added support for producing queries on the
> fly like you asked. :-)
>
>
>
>
> *Bruno Borges*
> (21) 7672-7099
> *www.brunoborges.com*
>
>
>
> On Fri, Jun 1, 2012 at 2:25 PM, soumya_sd <[hidden email]> wrote:
>
>> I'm trying to use Camel twitter component.
>> http://camel.apache.org/twitter.html
>>
>> I want to create a route like -
>>
>>                from("direct:twitter-search").to(
>>
>>
>> "twitter://search?type=polling&delay=20&keywords=mykeywords&consumerKey=key&consumerSecret=secret&accessToken=xxxxxxx&accessTokenSecret=yyyysecretxxxx")
>>                                .to("stream:out");
>>
>>
>>
>>
>> However, looks like this is not supported (see exception below). Can
>> someone
>> explain why?
>>
>>
>> *org.apache.camel.FailedToCreateProducerException: Failed to create
>> Producer
>> for endpoint:
>>
>> Endpoint[twitter://search?...........&delay=20&keywords=mykeyword&type=polling].
>> Reason: java.lang.IllegalArgumentException: Cannot create any producer
>> with
>> uri
>>
>> twitter://search?accessToken=.........&delay=20&keywords=mykeyword&type=polling.
>> A producer type was not provided (or an incorrect pairing was used).*
>>
>> Given that twitter component internally makes use of HTTP REST calls it
>> should be possible to use it both as a consumer as well as a producer.
>>
>> For example, I can successfully execute the following route with the http
>> component.  I cannot understand why I cannot do the same with the twitter
>> component ?
>>
>> from("direct:startgoogleplaces")
>>                                .process(new HTTPRequestParamProcessor())
>>                                .setHeader(
>>                                                Exchange.HTTP_QUERY,
>>
>>
>> simple("location=${in.headers.location}&radius=${in.headers.radius}&types=${in.headers.types}&sensor=${in.headers.sensor}&key=${in.headers.key}"))
>>                                .to("
>> https://maps.googleapis.com/maps/api/place/search/json")
>>                                .unmarshal()
>>                                .json(JsonLibrary.Jackson,
>> GooglePlaceResponseObject.class)
>>                                .log("before split the body is
>> ${body}").to("stream:out);
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>