cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: Timeout handling for generators?
Date Thu, 29 Jun 2006 09:10:51 GMT
Hello, I had a similar problem ones, and chose to solve it by reading the rss from local filesystem.
This made it much faster and cacheable. 

In the background I had a cronjob runnning to save the rss to local file system every 5 min
(unless the feed is unavailable)


A cleaner way whould perhaps be looking into the HttpProxyGenerator, and instead of 

HttpConnection connection = new HttpConnection(this.method.getHostConfiguration());

use the connectionManagerImpl and create a connection with a timeout. That should work.

The result, you could store in cache. Then, next time a request is done for the rss, and the
request succeeds, you reaplace the cached part, if you get a connectionTimeOut, you return
the cached value. If you only want to look every 5 min if the rss changed, to have better
performance, you put the entire pipeline for the rss part in an expiring pipeline.

Hope everything is clear,

Regards Ard

-- 

Hippo
Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466
-------------------------------------------------------------
a.schrijvers@hippo.nl / http://www.hippo.nl
-------------------------------------------------------------- 

> 
> hi cocoon users
> 
> is there a generator to get external documents with HTTP that has a 
> built-in timeout-handling?
>
> the default generator work fine like this:
> <map:generate src="http://host/path"/>
> but if the requested resource isn't available an error page 
> is coming up.
> 
> i'd like to get an atom-feed from blogger.com and everythings works 
> fine, but if my site can't reach blogger, it's broken.
> 
> i saw there is such a piece of functionality in 
> cocoon-portal-coplets, 
> but i didn't find anything in cocoon itself. the 
> wsproxy-generator seems 
> to miss a timeout too.
> 
> thanks and regards
> stefan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message