I'm currently struggling with something and I suspect I'm just not
approaching this from the correct angle. Basically, I'm building an
application to support passing messages from our backend system to
agents we have running on client computers out "in the field". Of
course, those agents can't talk directly to our backend for reasons
that are too complicated and not worth going into right now. Instead,
we use special agents called delegates to handle the connections. Each
delegate might manage messages for as many as 1000 endpoints.
I'm trying to figure out the best approach for receiving these
messages. Currently, I'm using a very hacked together approach where I
build a message selector with the ids of each of the agents the
delegate handles and use that to grab messages from the queue. The
other alternative I played with, but didn't like, was creating a
connection for each agent and having the delegate manage all of these
connections, waiting for messages (we use a 90 second wait period).
I'm not really comfortable with leaving up to 1000 connections around
for each delegate on a regular basis (these delegates will be checking
in constantly, reopening the connection every few minutes).
Any suggestions for a better approach? Is there something I'm
completely overlooking here? More information I need to supply?
Thanks,
Thomas