I'm looking for some advice on how to proceed.
Here's the scenario:
I've got to develop a high availability VB.Net web service that basically
acts as a middle man between the web service clients and a third party data
provider. The third party data provider is accessed over a well defined TCP
interface. The third party data server can accept about 25 concurrent TCP
connections from the same client.
The web service will accept client requests, translate the requests into a
format suitable for the third party service, forward the request to the third
party service, wait for the replies from the third party service, translate
the replies into a format suitable for the web service client and return the
response to the web service client. This web service will need to handle
many simultaneous client requests.
Establishing a connection to the third party data service is a rather
lenghty process and I'm thinking the web service needs to maintain a number
of TCP connections in some kind of object pool. Also, the connections made
to the third party service need to be asynchronous, able to handle
unsolicited messages from the data server, maintain a heart beat requests,
identify broken or out of sync connections, and destroy itself and create a
new connection if a problem is identified.
A prototype version of the web service uses a public variable defined in a
VB module to hold the array of objects that maintain the connections to the
third party web service. After reviewing how ASP.Net manages the application
domain and its associated threading behavior, I'm concerned that it's
possible that ASP.Net may create multiple instances of the application and in
turn attempt to create even more new connections to the third party data
server exceeding the maximum allowable connections and causing all sorts of
problems.
If I create my own object pool using a singleton model, I have similar
concerns regarding ASP.Net's threading behavior.
If I use component services for object pooling, I'm concerned that I can't
properly manage object creation and destruction if there are problems
identified with the underlying TCP connection.
I'd really like some advice here on how to manage a pool of connections to
the third party data provider and how to manage the use of these objects
through a web service. Thanks