Re: Serving remote clients - RMI vs HTTP
Gregg Wonderly <[email protected]> Mon, 16 Jul 2007 10:17:21 -0500
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <[email protected]> |
kumarlimbu wrote:
> We want to know if RMI is more suitable for our specific purpose. We
> did some research and found out that RMI (with clustering support) might be
> more suitable for our needs. Unfortunately our team is not familiar with RMI
> and so we don't know if there will be any issues with it during
> implementation. Advantage of using simple GET/POST is we have more control
> over which searcher app to use and when. Another criteria is to disable
> searching from the searcher app who's index is being updated. This is very
> important for us. Is there anyway in RMI to inform the
> web (client) application that a particular server is unavailable.
>
> We would also like to know if anybody has implemented lucene searching in a
> similar fashion. Thanks for your help.
This sounds like a great application to use Jini/Javaspaces on. What you would
do, is create a javaspace that all search requests are placed in, with
instance-Ids and search strings
public class SearchEntry extends AbstractEntry {
public String searchFor;
public Uuid inst;
}
If you need other data, then add to or alter this as needed.
Then, you're web app would submit these entries into the javaspace. You would
define a second Entry type as in
public class SearchResult extends AbstractEntry {
public Uuid inst;
public Results res;
}
to hold the result data. The web app would then issue a "take" on a result
object with the Uuid for it's client request.
The search activities would be farmed out to machines with threads issuing
"take" on the SearchEntry objects. They would perform the search, and then put
the results back into the space with the same Uuid as the request.
Since the search engines are performing the take-work-put operation, you can
just take them out of service by disabling this activity while you upgrade.
Gregg Wonderly
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html
To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html