Hey everyone - fairly new to the Restlet framework, but have found it quite 
valuable so far - thank you.  I've been batting around an idea (explained 
below) and wanted to get a sound-off to see if my logic is heading in the right 
direction.  Appreciate your input/insights.

Basically, I'm using Restlet to expose some functionality of a Java-native 
ontology inferencing library (Pellet) over HTTP as a RESTful API-style wrapper 
against biomedical concepts. We use this for a large number of activities such 
as text mining and data annotation, and the access to web-wrapped Pellet logic 
is useful, especially since we are largely a .NET shop.  The Restlet service is 
built, stable, and running great.  However, based on the server load at any 
time, the call may take a minute to compute (since inferencing is fairly 
computationally-intensive).  Calls issued to a server in rapid succession can 
result in a long request queue.

We have a number of resources running the service and with an extension I wrote 
with JGroups, can communicate with each other via UDP multicast.  I was hoping 
I could use this mechanism to, should a server detect a large queue of 
requests, query the cluster of resources to find a node which has less work 
allocated to it, craft a 300 redirect based on the response it receives, and 
send it off to the client.  The client would then re-issue the HTTP call to the 
server specified in the redirect.

The logic seems fairly sound in my head, but a few questions remain:
1. Does the Restlet framework provide any way to access lower-level threading 
objects to "detect" how much of a work payload it currently has?
2. Is there some more obvious/less painful way (i.e. some Restlet extension) of 
doing this?

Seems like all I would have to do is implement some functionality which is 
executed before the request is processed, determine if the request can be 
processed in a reasonable amount of time, and if not, find a node which does.

Hoping someone with a greater knowledge of the inner workings of the Restlet 
framework would be able to provide some insight.

Thanks for your time in advance.

Regards,

Tim

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2756181

Reply via email to