thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Chambers <mvchamb...@me.com>
Subject Re: Can separate generated serialization code from generated datatype definitions?
Date Fri, 05 Dec 2014 18:27:33 GMT

Hibernate is always in the way.

Usually I just slap an HTTP Servlet up to serve my thrift services, then people can use the
thrift jquery client on top of my existing service instance that is already being served out
by another thrift server.

public class ThriftServlet extends TServlet implements HttpRequestHandler {

    @Autowired
    public ThriftServlet(PlowRpcService.Iface service) {
        super(new PlowRpcService.Processor<PlowRpcService.Iface>(service), new TJSONProtocol.Factory());
    }

    @Override
    public void handleRequest(HttpServletRequest req, HttpServletResponse rsp)
            throws ServletException, IOException {
        doPost(req, rsp);
    }
}

-Matt

On Dec 5, 2014, at 12:35 PM, Stuart Reynolds <stu@stureynolds.com> wrote:

> Thanks -- I know about RowMapper (and many other workarounds).
> Hibernate is one of many serialization frameworks I work with (I'm
> happy with it, for the most part, and go around it when it gets in the
> way).
> 
> We also have a REST interface, and would like JSON or XML
> serialization of our business object. Here, again, I'd like to
> serialize these objects as plain JSON (not thrift JSON which adds
> considerable requirements on a REST client). Allowing Thrift exclusive
> ownership of the object definitions is a hindrance.
> 
> - Stuart
> 
> 
> On Fri, Dec 5, 2014 at 8:25 AM, Matt Chambers <mvchambers@me.com> wrote:
>> Correction
>> 
>> public List<ProjectT> getAll() {
>>        return jdbc.query("SELECT * FROM project", MAPPER);
>> }
>> 
>> On Dec 5, 2014, at 11:21 AM, Matt Chambers <mvchambers@me.com> wrote:
>> 
>>> public List<ProjectT> getAll() {
>>>      return jdbc.query("SELECT * FROM project");
>>> }
>> 


Mime
View raw message