thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Slee <>
Subject RE: How to use TBufferedTransport in Java ?
Date Wed, 30 Mar 2011 18:18:23 GMT
Also will note that part of the reason TBufferedTransport isn't generally necessary in Java
is that by default your Java VM will typically already have a stage of output buffering on
its Socket implementation. Wrapping that up in a TBufferedTransport would just burn up CPU/memory
to no advantage.

The buffering/streaming that the white paper describes isn't actually beneficial in practice
for typical moderate-payload RPC use cases, which is what most people use Thrift for. The
goal there was to not make it *impossible* to do those things with Thrift, but if you're just
issuing basic RPCs, the framed transport makes things a lot easier to debug as each payload
is sent over the wire with a frame header containing its size.

-----Original Message-----
From: Shrinath M [] 
Sent: Wednesday, March 23, 2011 9:21 PM
Cc: Bryan Duxbury
Subject: Re: How to use TBufferedTransport in Java ?

Why would you recommend Framed Transport ?
Isn't that the opposite to whats described in section 4.2 in the white paper

And can you show me an example usage of TIOStreamTransport on Java ?
I didn't see one proper example anywhere...
I've doubts like should we create a socket ? Can we have multiple
buffers accessing the different streams like we can do on Framed Transport

On Wed, Mar 23, 2011 at 10:57 PM, Bryan Duxbury <> wrote:

> You are correct - there is no BufferedTransport in Java. This is because we
> have TIOStreamTransport, which can be wrapped around a Java
> Buffer(Input|Output)Stream to raw buffering if that's what you need. I
> would
> strongly encourage you to use Framed Transport (on both sides) instead.
> On Wed, Mar 23, 2011 at 4:26 AM, Shrinath M <> wrote:
> > I am unable to find any way to get the TBufferedTransport working in
> Java.
> > I also read somewhere<
> >>
> > that
> > its missing totally from Java implementation of thrift.
> > If so, what is the alternative ?
> >
> >
> > --
> > Regards
> > Shrinath.M
> >

View raw message