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 <[email protected]> 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: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to