I have developed a set of interface classes for my client-server system that allow me to switch in either ActiveMQ or MQSeries. I have been testing what happens when the connection is lost to the Q mgr. I have arranged for the server to halt so that it is restarted from the script that kicks it off in the first place. I have arranged for the client to detect that the connection has gone away and for it to reconnect. With MQSeries this works. Here are some observations about what I had to do to get it work:
On the client side with ActiveMQ the receive behaves like it times out when the connection goes away. So when that happens I write a heartbeat message to the rqst Q. That does fail if the Q mgr is not there. I found that with MQSeries the receive fails with an exception. So, with MQSeries a heartbeat approach is not needed. I must admit, the MQSeries behaviour is what I would expect. I was suprised when ActiveMQ didn't do this. Can anyone comment please? On the server side I saw similar issues but I react to them differently. I make the server die, since the script that kicks it off will restart it. Eventually when the Q mgr comes back this means the server will be up and running ok. With MQSeries this is just fine, but with ActiveMQ the server just sits in the receive loop. The server cannot write heart beats anywhere so I cannot use that approach on the server side. I tried using an ExceptionListener but it seemed like it was not picking up anything. Using an ExceptionListener was a right pain to add, especially because afterwards I discovered that MQSeries does not need it (or invoke it). What do people do to make their AMQ-cpp servers detect that the Q mgr has gone away? I originally picked ActiveMQ to make things easier to develop and test with. It was always going to go into production with MQSeries. It is quite ironic that it ha actually been easier to do the development with MQSeries. Regards, Andrew Marlow ___________________________________________________________ This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is prohibited. Please refer to http://www.bnpparibas.co.uk/en/information/legal_information.asp?Code=ECAS-845C5H for additional disclosures.