I have 3 async servers and clients connected each other, like a chain.
A request goes through the 3 system like
=> System 1 => System 2 => System 3 =>
And the response
=> System 3 => System 2 => System 1 =>
I have a logic in each of this systems in order to join the response with the correct request. With that logic I manage to process responses and requests in different order.
Today I have only a single connection between the systems. And I notice that only one thread is used, and the performance is not good... :(
Are there any configuration to force use more than one thread per connection? Is this the correct way of solve this problems? Or I have to have a pool of connection between each systems?, Has netty some kind of this pool or I have to implement it by my own?
I'm using netty 5.
Thanks a lot.
See the Netty wikis for a good general description of the threading model. In summary Netty 4.0+ will not introduce concurrency into the channel handling operations. Check out the majority of the netty examples and you will notice the lack of synchronization because of this. Operating on channels concurrently would introduce more complexity to the framework and interface to interact with the framework.
I think the question is does your use case support being split amongst multiple channels? It depends upon a lot of factors but if you algorithms and data support parallelization then you may see improvements in overall throughput.
Netty does provide a ChannelGroup but I'm not sure if this fits in with your usecase.