package server;
import tutorial.Calculator;
public class CalculatorTServlet extends TServlet {
public CalculatorTServlet() {
super(new Calculator.Processor(new CalculatorHandler()));
}
}
Invoking the service is easy - you just use the
THttpClient
transport. Using Thrift over HTTP allows you to use all your existing high-availability and failover infrastructure, which can be attractive. (But also see this Thrift mailing list thread which gives some more detail on how Facebook tackles high-availability and failover.)
2 comments:
Tom,
This is pretty cool. It has been 3 years, since you posted this. Have you used this in a practical applications? Any experiences you can share?
Soma
Hi there,
Since this is the only reference found by google, and the link is outdated, I decided to save fellow searchers the extra trouble and point directly to:
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/TServlet.java?view=markup
And the history:
https://issues.apache.org/jira/browse/THRIFT-814
Post a Comment