You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by skazy <zi...@gmail.com> on 2013/08/13 13:25:27 UTC

Camel RSS component can't be used as Producer Endpoint

Hi,

I am trying to use camel-rss component as follow:

from("timer://timerCamel?repeatCount=0&delay=1000&period=300000")
    // ... route steps for fetching the list of urls from database
   
*.to("rss:http://rss.cnn.com/rss/edition.rss?splitEntries=false&consumer.delay=1000")*
    // ... some additional route operations
.log(LoggingLevel.INFO, "route end");

The main problem is that camel-rss component currently doesn't support the
way to call endpoint rss:... by route method to(). See the exception bellow:


2013-08-13 13:13:01,819 | ERROR | NAPSHOT-thread-1 | BlueprintCamelContext           
| .blueprint.BlueprintCamelContext  130 | 91 -
org.apache.camel.camel-blueprint - 2.10.0.redhat-60024 | Error occurr
ed during starting Camel: CamelContext(news-covers) due Failed to create
Producer for endpoint:
Endpoint[rss://http://rss.cnn.com/rss/edition.rss?consumer.delay=1000&splitEntries=false].
Reason: java.la
ng.UnsupportedOperationException: FeedProducer is not implemented
org.apache.camel.FailedToCreateProducerException: Failed to create Producer
for endpoint:
Endpoint[rss://http://rss.cnn.com/rss/edition.rss?consumer.delay=1000&splitEntries=false].
Reason: java.lang.Uns
upportedOperationException: FeedProducer is not implemented
        at
org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:395)

Does anybody know the wright way to solve my problem?

Thank you.

Regards,

Ziga



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-RSS-component-can-t-be-used-as-Producer-Endpoint-tp5737203.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel RSS component can't be used as Producer Endpoint

Posted by Willem jiang <wi...@gmail.com>.
Did you have chance to check out the link of pulling consumer[1]?
you can pull the feed with ConsumerTemplate.

[1]http://camel.apache.org/polling-consumer.html  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Wednesday, August 14, 2013 at 4:00 PM, skazy wrote:

> Hi Williem,
>  
> it is not about periodicaly camel pull. It's about that how to pull more
> than one URL by camel-rss component. I have the list od feed urls to pull in
> single route.
>  
> Ziga
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-RSS-component-can-t-be-used-as-Producer-Endpoint-tp5737203p5737233.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: Camel RSS component can't be used as Producer Endpoint

Posted by skazy <zi...@gmail.com>.
Hi Williem,

it is not about periodicaly camel pull. It's about that how to pull more
than one URL by camel-rss component. I have the list od feed urls to pull in
single route.

Ziga



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-RSS-component-can-t-be-used-as-Producer-Endpoint-tp5737203p5737233.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel RSS component can't be used as Producer Endpoint

Posted by Willem jiang <wi...@gmail.com>.
Hi,

You can use the consumer.delay, consumer.userFixedDelay to camel pull the RSS feed periodically.  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Wednesday, August 14, 2013 at 1:41 PM, skazy wrote:

> Hi Bilgin,
>  
> I have to write the route which periodicaly reads the list of RSS feed urls
> from database (timer component) and then parse each url with rss component
> and finally store feed items into solr index. So I have many feed urls to
> fetch and parse in one camel route.
>  
> Do you know for any route pattern to ahieve this route process?
>  
> Thank you.
>  
> Ziga
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-RSS-component-can-t-be-used-as-Producer-Endpoint-tp5737203p5737227.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: Camel RSS component can't be used as Producer Endpoint

Posted by Borut Bolčina <bo...@gmail.com>.
Hi,

so the RSS component is not able to receive a list of URLs and process them
one by one? IMHO this does not seem like a good design for a component.

-borut


2013/8/14 Bilgin Ibryam <bi...@gmail.com>

> You will have to use http component and manually process the feed or
> dynamically create routes using the url from db and rss consumer.
>
> B.
>
> Sent from mobile
> On 14 Aug 2013 08:41, "skazy" <zi...@gmail.com> wrote:
>
> Hi Bilgin,
>
> I have to write the route which periodicaly reads the list of RSS feed urls
> from database (timer component) and then parse each url with rss component
> and finally store feed items into solr index. So I have many feed urls to
> fetch and parse in one camel route.
>
> Do you know for any route pattern to ahieve this route process?
>
> Thank you.
>
> Ziga
>
>
>
> --
> View this message in context:
>
> http://camel.465427.n5.nabble.com/Camel-RSS-component-can-t-be-used-as-Producer-Endpoint-tp5737203p5737227.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel RSS component can't be used as Producer Endpoint

Posted by Bilgin Ibryam <bi...@gmail.com>.
You will have to use http component and manually process the feed or
dynamically create routes using the url from db and rss consumer.

B.

Sent from mobile
On 14 Aug 2013 08:41, "skazy" <zi...@gmail.com> wrote:

Hi Bilgin,

I have to write the route which periodicaly reads the list of RSS feed urls
from database (timer component) and then parse each url with rss component
and finally store feed items into solr index. So I have many feed urls to
fetch and parse in one camel route.

Do you know for any route pattern to ahieve this route process?

Thank you.

Ziga



--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-RSS-component-can-t-be-used-as-Producer-Endpoint-tp5737203p5737227.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel RSS component can't be used as Producer Endpoint

Posted by skazy <zi...@gmail.com>.
Hi Bilgin,

I have to write the route which periodicaly reads the list of RSS feed urls
from database (timer component) and then parse each url with rss component
and finally store feed items into solr index. So I have many feed urls to
fetch and parse in one camel route.

Do you know for any route pattern to ahieve this route process?

Thank you.

Ziga



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-RSS-component-can-t-be-used-as-Producer-Endpoint-tp5737203p5737227.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel RSS component can't be used as Producer Endpoint

Posted by Bilgin Ibryam <bi...@gmail.com>.
Hi Ziga,

rss component has only consumer, so you can use it only in from(...)

Why do you need to use timer?

Bilgin


On 13 August 2013 12:25, skazy <zi...@gmail.com> wrote:
> Hi,
>
> I am trying to use camel-rss component as follow:
>
> from("timer://timerCamel?repeatCount=0&delay=1000&period=300000")
>     // ... route steps for fetching the list of urls from database
>
> *.to("rss:http://rss.cnn.com/rss/edition.rss?splitEntries=false&consumer.delay=1000")*
>     // ... some additional route operations
> .log(LoggingLevel.INFO, "route end");
>
> The main problem is that camel-rss component currently doesn't support the
> way to call endpoint rss:... by route method to(). See the exception bellow:
>
>
> 2013-08-13 13:13:01,819 | ERROR | NAPSHOT-thread-1 | BlueprintCamelContext
> | .blueprint.BlueprintCamelContext  130 | 91 -
> org.apache.camel.camel-blueprint - 2.10.0.redhat-60024 | Error occurr
> ed during starting Camel: CamelContext(news-covers) due Failed to create
> Producer for endpoint:
> Endpoint[rss://http://rss.cnn.com/rss/edition.rss?consumer.delay=1000&splitEntries=false].
> Reason: java.la
> ng.UnsupportedOperationException: FeedProducer is not implemented
> org.apache.camel.FailedToCreateProducerException: Failed to create Producer
> for endpoint:
> Endpoint[rss://http://rss.cnn.com/rss/edition.rss?consumer.delay=1000&splitEntries=false].
> Reason: java.lang.Uns
> upportedOperationException: FeedProducer is not implemented
>         at
> org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:395)
>
> Does anybody know the wright way to solve my problem?
>
> Thank you.
>
> Regards,
>
> Ziga
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-RSS-component-can-t-be-used-as-Producer-Endpoint-tp5737203.html
> Sent from the Camel - Users mailing list archive at Nabble.com.