Http integration issues
Johnny Luong
johnny.luong at trustcommerce.com
Wed Sep 28 14:16:01 EDT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 09/27/2011 04:18 PM, bburke wrote:
> I'm integrating RESTEasy with Netty. One big problem I'm having is that I
> have to implement a synchronous input model over netty's asynchronous input
> model.
>
> In other words, I have to create an InputStream for an HTTP message body and
> send it off to resteasy/jaxrs/application code to be processed. Works fine
> if you buffer the *entire* incoming message in memory that hands off
> everything to Resteasy. Great for unit testing.
>
> But, if we want to use Netty as a real HTTP server, i need to be able to
> pull the channel for events, rather than have them pushed. Otherwise, I'll
> have to create a separate thread and do context switching for any HTTP
> request that is Chunked. Which will pretty much be a significant(?)
> performance hit.
>
> Maybe I just don't understand Netty...Apologies if this is a RTFM problem as
> I've only looked at the Http example program.
>
> Thanks,
>
> Bill
>
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Http-integration-issues-tp6838225p6838225.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
>
I don't think there is a direct correlation between the raw ByteBuffer
or event you see from Netty to an InputStream/OutputStream, but you
could probably simulate the byte passing portion via the
PipedInputStream/PipedOutputStream and your own custom handler to deal
with the various events like Open/Close. But if you are thinking the
performance from the context switch will be too high, its not clear what
you could do short of writing your own event consumption code and this
might mean the loss of using the library you chosen.
Best,
Johnny
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with CentOS - http://enigmail.mozdev.org/
iQIcBAEBCAAGBQJOg2RhAAoJENQfv1FjsMMv7SkQALjGzGUCLlZo+Tja9VfM9THr
7DNV3jWM8WqmH3IXoqSdjPYnNYFLYl6yq56QiCRlvJsaAFGw929qlRRQLsxxUUh7
TEAwDEqZitPO7Q5MjcaDTcdztbUfaOdHHkGZttqo8TeR0b3b7x6g3OCd7CkliTGb
OEmvhmA/WXIhG1ZOJ0a7XXqIVGjawXYMLTpR5wygnihta9jOlst6no5RKGW+jIMF
rpe0s8sPt4EIceXJeSNlLuSKDrHb6M6m6atFNhZZo64peNeoMV+zxOzjYLgtGOM3
6/7xLK9jGu20LobIDgvZ7tXfctqXgkS3lVhPiYuJnaShbnbs9+6WOJnUr3KJithB
wWsKHHC7DzhNodxSrIKdSmuTgb3rkd8hwXh3EPOF25JkIDBfBVtb/NnjAMZmjB5Y
r1pzW0Y8nSihYUOs+mhHjQO7ByNcDd/5xlVA1x3/v85RJ0flOBj5ax1qxrcoL1h7
wv8ZwVEsYgIE0LpvY8YSYwj68y4hNZ0Lv7WIHsvE384HqnUmECY7blXeoHn/cx34
9ykTm5+UWG8hhnOEkGj6xcnMLyX54T9cFazzHSnvBw1zEB+UyIjLb66DbmHvfenW
63k7IoeVWE+5d4iKwvuQLOPTHHpnQ9cEbZQOOp0suELhVO4NNW8lyeUr+e/e9YtM
DQma0qRqxMq8db/hXZuL
=3TpB
-----END PGP SIGNATURE-----
More information about the netty-users
mailing list