Using Netty

Trustin Lee tlee at redhat.com
Thu May 14 23:55:48 EDT 2009


On Fri, May 15, 2009 at 12:38 PM, Dai Jun <guiwuu at gmail.com> wrote:
> Hi,
>
> On Wed, May 13, 2009 at 1:30 PM, Christian Migowski
> <chrismfwrd at gmail.com> wrote:
>> Hi Rajks,
>>
>> just some random pointers from another Netty user:
>>
>> On Wed, May 13, 2009 at 2:46 AM, rajks <rajks at hotmail.com> wrote:
>>>
>>> Should I implement the DB server also as Netty NIO HTTP based and use the
>>> Netty NIO HTTP client as means to communicate between front end servers and
>>> db servers. NOTE: each front end server will be communicating with many
>>> back-end DB servers. We would like to have PERSISTENT connections with some
>>> limit per host;
>>
>> If I don't have to, I wouldn't use http as communication protocol.
>> IIRC http had originally non-persistent connections only (I am not
>> familiar with Nettys http implementation), also it has probably more
>> features (which means more overhead) then you need for your servers
>> talking to each other.
>> IMHO designing a simple protocol (with a small header like
>> <msglength><actioncode><msgId> ) for your own use would be better
>> (less complex in case of problems, propably more efficient)
>
> I am also interesting in big file transferring. If the network
> environment is not efficient, like DB or NFS mentioned in rajks's
> case, I wander how to complete a transferring and make sure it
> correct? Should I have to encode file into many frames and decode them
> to the original one in the other end?

Because nowaday's JDBC and NFS access are synchronous, there's no
other way than setting a timeout IMHO.  Mike Heath has implemented an
asynchronous JDBC for MySQL, so you might find it useful though -
http://code.google.com/p/adbcj/

Also, please note that completing a write request and chunking are not
related with each other.  Chunking is only useful when you want to
receive partial data earlier or reduce the memory pressure.

— Trustin Lee, http://gleamynode.net/




More information about the netty-users mailing list