Graceful shutdown

Trustin Lee (이희승) trustin at gmail.com
Thu Nov 19 22:50:12 EST 2009


Hi,

On Mon, Nov 9, 2009 at 12:17 PM, rajks <rajks at hotmail.com> wrote:
>
> Hi,
>
> I am using the netty HTTP server example as the base and I am also using the
> http client as the backend.
>
> 1. Since the server is creating a server factory and client factory, do I
> need to use two individual channelgroups to add channels of server and
> backend clients respectively or use a single channelgroup for both the
> server and client backend channels - to do graceful shutdown. I am using the
> graceful shutdown method described by TL in the forum.

If you don't care about the order where the channels are closed, it's
just fine with one ChannelGroup.

> 2. MY server will receive http requests  and make a backend http calls to
> different servers.
>    Do I need to create/maintain a MAP of { client factory, host:port} and
> reuse the factory or do I need to create a separate factory everytime for
> every connection. The backend connections may or may not be persistent.

You should reuse the ChannelFactory for all connections.  You don't
even need a map.  You need only one factory that handles all outgoing
connections.

HTH

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



More information about the netty-users mailing list