I have a Scala application that supports (or tries) a TCP connection to various servers for several hours (maybe> 24) at a time. Each server sends a short message ~ 30 characters approximately twice a second. These messages are passed to iteration, where they are parsed and ultimately bring state changes to the database.
If any of these connections does not work for any reason, my application should constantly try to connect, unless I specify otherwise. Any lost messages are bad. I do not control the servers to which I connect, or the protocols used.
It can be assumed that there will immediately be 300 such connections. There is definitely no high-load scenario, so I don’t think NIO is needed, although it might be nice to have? Other application bits have a high load.
I am looking for some kind of controller / socket manager that can support these connections as reliably as possible. Now I run my own lock controller, but since I'm inexperienced with socket encoding (and all the various settings, options, timeouts, etc.), I doubt that it will achieve the best uptime. Also, I might need SSL support at some point down.
Will NIO offer any real benefits?
Would Netty be the best choice here? I saw the Uptime example here and thought of simply duplicating it, but as a newbie to lower-level networks, I was not sure there were better options.
Grant source share