Netty Client concurrency

Xiao Li xiao.k.li at googlemail.com
Sat Oct 22 20:28:16 EDT 2011


While handling of request on one channel is serial, you can put requests
that need concurrency into different connections.
Establish a server on your current "client" side to handle requests can be a
candidate solution.

-Xiao

On Sat, Oct 22, 2011 at 9:25 PM, 金剑 <jinjian.1 at gmail.com> wrote:

> 1. Your code only create an instance when you getPipeline().  executionHandler
> just provide a thread pool.
>
> 2. One client is one connection, if you want to send multiple request, you
> can use multiple connection or pipeline your request(If your server or
> protocol support it).
>
>
>
>
>
> 在 2011年10月21日 上午10:25,Liuxianning <liuxianning at huawei.com>写道:
>
>>  Hi Guys
>>
>>
>>
>>     There are 2 Modules in my project. I used Netty as channel between
>> them.I used the long connection. In the pipelinefactory of clientside
>> module, the code as follows
>>
>>
>>
>>      public ChannelPipeline getPipeline()
>>         throws Exception
>>     {
>>         ChannelPipeline pipeline = Channels.pipeline();
>>         pipeline.addLast("decoder", new MessageDecoder());
>>         pipeline.addLast("ThreadPoolHandler", executionHandler);
>>         pipeline.addLast("handler", new ClientHandler());
>>         return pipeline;
>>     }
>>
>>
>>
>> the code get response as follows:
>>
>>
>>
>>             ClientHandler handler =
>> channel.getPipeline().get(ClientHandler.class);
>>             return handler.getResponse(request);
>>
>>
>>
>> My problem is:
>>
>>  1. is there only one ClientHandler instance even I used ExecutionHandler?
>>
>>  2. When there is multi-thread send request, all the get response is
>> blocked in the ClientHandler, How should i improve the client concurrency?
>>
>>
>>
>> Any suggestion is many thanks.
>>
>>
>>
>> Sincerely
>>
>> Liuxianning.
>>
>>
>>
>> _______________________________________________
>> netty-users mailing list
>> netty-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/netty-users
>>
>
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20111023/454c2d49/attachment.html 


More information about the netty-users mailing list