I have a new project and I'll be using Netty for the first time (v4.0.4). I'll have a server with tens of thousands of connected clients. The server will send commands to these clients and should receive responses.
Looking through the API and the online examples I am not sure how to model my clients from the server's perspective. I have organized my channels into various ChannelGroups, and I can send commands just fine.
I'll need to know if a command times out or if an error code is returned. I may need to maintain a command queue for each client as well. Should I use a ScheduledExecutorService to set a timeout handler for each command then just cancel the Future when/if the response comes in?
Would it be a good idea to subclass Channel to encapsulate this logic? Or should I use some type of session storage and put the logic in my inbound channel handler?
I'm sure these methods will work but they seem a bit awkward and I want to make sure I'm doing things the netty way.
Thanks!