Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open/Close Timing

Status
Not open for further replies.

MRickman

Programmer
Oct 26, 2005
2
CA
Does anyone know of any limitation of the time needed to Connect/Open and Disconnenct/Close the connections to the queue. I have a client application (written in C++) that is rapidly performing the following steps:
- Connect
- Open
- Put
- Close
- Disconnect

The time between the Disconnect and the next Connect is sometimes as short as 10 milliseconds. On the server side it is seeing the Open and Put, but not the Close/Disconnect, and as a result it is creating a handle leak. I'm not sure whether or not the problem is being caused by the speed in which I am making calls. Is it possible that I need to leave more time between Disconnect and Connect because the Disconnect is not being given time to adequately finish? I can see this being a problem, but I would have thought that eventually the Disconnect would be processed, instead of it not being seen at all.

Thanks in advance,

MikeR
 
First....MQCONN is the most 'costly' MQ call so if this application is looping with the CONN in it it should be re-written to only issue one connect. If that connection fails during the transactions life time then it should re-connect.

Next.... If the messages are always to the same queue...only one open is needed and the PUTS can be in a loop. (it will be up to you to decide what warrants the work as complete)

Next...If the program is specifially just going to perform the actions you indicated....use MQPUT1 it is far more efficient.

Hope this helps
 
These are good suggestions and I am looking into making some design changes. I still have a couple of questions, though:

1) While your suggestions make a lot of sense from an efficiency point of view, it still doesn't say whether or not what I am currently doing will fail. Are you saying that whay I am doing is wrong, or just not ideal?

2) I thought that I read somewhere that there could be problems with leaving the queue open for extended periods of time. My application is to be running in a 24/7 environment. Should I be concerned with this?

Thanks

MikeR
 
Hi

1) No. Your current setup should not fail...it is just not ideal.

2) I have not heard of any problems leaving queues open for extended periods of time. The only 'issue' would be for backups. If queues are open (which in turn implies that the queue manager is running) then the backup is considered a 'fuzzy' backup.

We have queues that are open 24x7 with no ill effect....in fact the queue managers holds several queues open for the duration of is 'lifetime'.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top