multiple clients <--> Cloverleaf (multi-server) <--> Server(EMPI)
The way I setup Cloverleaf is that I have a TPS Inbound Data TCL proc that appends the DRIVERCTL data to the message. The message is then routed/translated to a HL7 query message and sent to a Server. The server will send the query results back, which is routed/translated back to the inbound thread. A TPS Outbound Data TCL proc reads the DRIVERCTL from the message and modifies the DRIVERCTL so Cloverleaf knows which client to send the message to. I did not set a limit to the number of multi-server threads and max queue depths.
The reason we are using Cloverleaf is because it can easily translate the message format from one to the other.
There are some issues that I noticed:
The amount of time for the client to connect to Cloverleaf takes a long time. If a couple of clients connect to Cloverleaf and start sending it data, other clients will have trouble connecting to Cloverleaf. I noticed that if I spawned 100 clients who try to send a message to Cloverleaf, only about 8 can be connected a time. However I did notice that if I set all my clients to connect but not send data until all clients have connected, Cloverleaf would eventually allow all the clients to connect.
Cloverleaf seems to hold the query results if there are clients constantly trying to connect/send new messages to it. I believe the messages are just queued because Cloverleaf is busy. When there are no more new clients to connect and send a message, Cloverleaf will start sending the query results back to the clients quickly. The messages aren’t always queued, some clients who connected earlier will get the query results sooner (it just takes a long time). In this particular proof of concept the Server just echo’ed the message back so there was no query time.
What happens when the client disconnects and Cloverleaf sets the DRIVERCTL to send to a disconnected client. When I forced the Clients to close the Socket before Cloverleaf sends a response, Cloverleaf did not error out. Is there some way I can look up all the CONNID’s that Cloverleaf currently has so it will drop the query response if the client is disconnected?
In some of my testing, the process will stop with an error saying something about Cloverleaf trying to access a memory region outside of it’s assigned region. I was thinking that this was perhaps due to Cloverleaf trying to send to a client who was disconnected. For some reason, for today’s testing I do not get this error message anymore. Perhaps it just is a random bug. (edit… I tried forcing more than 8 Clients to be connected at the same time and seem to get this error more frequently).
[pti :sign:WARN/0: test1_ib:04/13/2007 10:52:34] Thread 2 received signal EXCEPTION_ACCESS_VIOLATION:
The thread attempted to read from or write to a virtual address for which it does not have the appropriate access.
Here are just possible solutions that I did not try, and I am not sure it will work:
Duplicate the inbound/outbound threads for different ports. Perhaps there is a limit to the amount of communication that can go over a single port at a time?
Use a java upoc protocol for the inbound thread an create a ServerSocket to manage the connections/receiving messages. It will probably be a static class so the read TPS and write TPS will use the same class (which holds the connection details).
Have the clients constantly maintain a connection to Cloverleaf instead of connecting only during a query. How is the memory usage for multi-server when more than 1000 clients are connected to it? I did not try yet.
Ideally we want the query to reach the Server(EMPI) as quickly as possible and the response to return back to the Client/user as quickly as possible.
Thanks for your time in reading this long post! Any suggestions or comments will be appreciated, thanks!
– Vincent