You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by soumya_sd <so...@yahoo.com> on 2012/06/01 19:25:34 UTC

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

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.

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

Posted by Bruno Borges <br...@gmail.com>.
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 <br...@gmail.com>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 <so...@yahoo.com> 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.
>>
>
>

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

Posted by Bruno Borges <br...@gmail.com>.
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 <so...@yahoo.com> 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.
>

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

Posted by Claus Ibsen <cl...@gmail.com>.
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 <so...@yahoo.com> 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: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

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

Posted by Bruno Borges <br...@gmail.com>.
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 <cl...@gmail.com> wrote:

> On Thu, Jun 14, 2012 at 8:33 PM, Bruno Borges <bruno.borges@gmail.com
> >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 <bruno.borges@gmail.com
> > >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 <
> > > christian.mueller@gmail.com> 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 <so...@yahoo.com>
> 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: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

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

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jun 14, 2012 at 8:33 PM, Bruno Borges <br...@gmail.com>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 <bruno.borges@gmail.com
> >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 <
> > christian.mueller@gmail.com> 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 <so...@yahoo.com> 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: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

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

Posted by Bruno Borges <br...@gmail.com>.
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 <br...@gmail.com>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 <
> christian.mueller@gmail.com> 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 <so...@yahoo.com> 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.
>> >
>>
>
>

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

Posted by Bruno Borges <br...@gmail.com>.
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 <
christian.mueller@gmail.com> 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 <so...@yahoo.com> 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.
> >
>

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

Posted by Christian Müller <ch...@gmail.com>.
"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 <so...@yahoo.com> 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.
>