You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Aron Sogor (JIRA)" <ji...@apache.org> on 2009/12/29 21:57:29 UTC
[jira] Commented: (THRIFT-631) Run Thrift inside Jetty
[ https://issues.apache.org/jira/browse/THRIFT-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795149#action_12795149 ]
Aron Sogor commented on THRIFT-631:
-----------------------------------
I would suggest to incorporate:
THRIFT-669
With this change on the server side you can do:
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("application/x-thrift");
OutputStream out;
try {
out = response.getOutputStream();
TBinaryProtocol inprotocol = new TBinaryProtocol(new TIOStreamTransport(request.getInputStream()));
TBinaryProtocol outprotocol = new TBinaryProtocol(new TIOStreamTransport(out));
while(true)
{
processor.process(inprotocol,outprotocol);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (TException e) {
e.printStackTrace();
}
}
This could be enhanced to do contination to cut the cost of open connections.
> Run Thrift inside Jetty
> -----------------------
>
> Key: THRIFT-631
> URL: https://issues.apache.org/jira/browse/THRIFT-631
> Project: Thrift
> Issue Type: New Feature
> Components: Compiler (Java)
> Reporter: Jerome Boulon
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.