ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Is there any IBM MQ APIs to check the MQ connection status

Post new topic  Reply to topic Goto page Previous  1, 2
 Is there any IBM MQ APIs to check the MQ connection status « View previous topic :: View next topic » 
Author Message
Vitor
PostPosted: Mon Aug 06, 2012 8:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
It could also be a bad compile.

It could also be that you're trying to use the C++ so/dlls on a version of the OS that they're not qualified for. The C++ APIs have been stabilized and no new function has been added to them in a couple of years. They have been recompiled at newer levels, but that doesn't necessarily mean you should still be using them.

EDIT: what I really mean here is - make sure you're using a known fixpack level of the C++ MQ libraries and that that fixpack level is certified for the platform you're on. And then look at refactoring to not use the C++ MQ libraries...




As I indicated above, I'd say bad build over bad code.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
steve_shad
PostPosted: Tue Aug 07, 2012 6:39 am    Post subject: Reply with quote

Newbie

Joined: 06 Aug 2012
Posts: 4

Thanks again for your inputs.

I found out from my customer that when this problem happened, the Queue manager at the remote end of one of our queues was not running. Once this was resolved, the problems ceased. However, from the application traces it does not look like we were trying to access that queue at the time of the crash, so this information is a little confusing.

mqjeff, to answer some of your points....

This application runs on HP-UX 11.31 with MQ version 7. I have found a discrepancy which may or may not be significant. On our development machines where the application is compiled and linked, we have these products installed using official IBM kits :

MQSERIES 7.0.1.3 WebSphere MQ for HP-UX
MQSERIES 7.0.1.5 WebSphere MQ update for HP-UX (U839626)

However, on the production system (runtime) the 7.0.1.5 upgrade is not there.

Looking at the build process, the application binary is linked against these libraries :

/usr/lib/libimqi23ah_r.so -> //opt/mqm/lib/libimqi23bh_r.so
/usr/lib/libmqic_r.so -> /opt/mqm/lib/libmqic_r.so

These are identical between dev and prod boxes.

Regarding the possibility of a memory leak, we had already checked for that with a monitor on the process vsz. We do not see any significant growth.

So far we have not been able to replicate this issue in a test environment, but are still trying to do that.

Regarding the section of code that calls ImqMgr:connect, please take another look at the stack trace in an earlier posting. You will see that it is not the application that is making this call - it is MQ further up the stack in response to the application call of the ImqQue::put entry point.

Regarding MQ trace I will investigate whether it will be possible to enable anything like this.

Regards,

Steve
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 07, 2012 9:54 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Could be due to the difference in fix pack levels...
7.0.1.3 although GA is still a little "rough" compared to 7.0.1.5

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mattfarney
PostPosted: Wed Aug 08, 2012 3:11 pm    Post subject: Reply with quote

Disciple

Joined: 17 Jan 2006
Posts: 167
Location: Ohio

There was a environmental flag named:
AMQ_ABORT_ON_EXCEPTION
that used to affect this behavior. It's probably still there but I don't know for sure.

Exporting that before starting should change the behavior, but I can't say I recommend it. I had to set mine to 'Y' to enable this behavior years ago. Otherwise, an MQ error could cause a deadlock between Oracle and MQ rollbacks. The signal behavior I believe is to trump any other waiting error handlers.

I believe. Your mileage may vary.

-mf
Back to top
View user's profile Send private message
steve_shad
PostPosted: Mon Aug 20, 2012 4:31 am    Post subject: Reply with quote

Newbie

Joined: 06 Aug 2012
Posts: 4

There have been a couple of references in this thread to the root cause of this issue being "bad code" or "code is hosed". I would be interested in members thoughts on the design philosophy of this MQ client app.

The module uses two input queues to read messages from, and a configurable number of queues on which to send replies. The reply queues are modelled in the application, and the incoming messages tell us which one to use.

On startup, a connection is made to the appropraite queue managers, and all queues are opened. They are maintained in an Open state throughtout the lifetime of the module.

If any Put or Get operation on a queue fails, the queue is closed, queue manager disconnected and the queue marked as unavailable. A "monitor" thread polls the state of all queues every 30 seconds and attempts to reconnect/open any queues marked as unavailable.

The MQ experts in our customer are suggesting we should recode our queue interface to connect/open the queue every time we use it. However, we are concerned about the overhead of doing this, the amount of work (design/implement/test) that our dev team would have to go through to achieve it, and also whether it is likely to solve the problem.

Our application has been working this way for over 10 years, and problems of this type have not been seen until recently.

Are there any opinions out there ?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 20, 2012 4:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's a bad idea to close/open every time. It's hard on MQ, and it's hard on your app.

The monitor thread is a bit unnecessary. I would typically just code the app to attempt the reopen if I get a bad return code from the PUT, and likewise attempt the reconnect if I get a bad return code from the OPEN.

We keep saying bad code because core dumps are not something that MQ typically does.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Aug 20, 2012 5:00 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9472
Location: US: west coast, almost. Otherwise, enroute.

steve_shad wrote:

The module uses two input queues to read messages from, and a configurable number of queues on which to send replies.

How many configurable reply-to-queues? 5, 10, 100, 5000?

Configurable how?

steve_shad wrote:
On startup, a connection is made to the appropraite queue managers,


The app MQCONNects to multiple queue managers concurrently? How many?

steve_shad wrote:
If any Put or Get operation on a queue fails, the queue is closed, queue manager disconnected and the queue marked as unavailable.

How is the queue marked as unavailable?

steve_shad wrote:

The MQ experts in our customer are suggesting we should recode our queue interface to connect/open the queue every time we use it.

Why are they suggesting this?

steve_shad wrote:
Our application has been working this way for over 10 years, and problems of this type have not been seen until recently.

Are there any opinions out there ?

Obviously, something has changed. Get an MQ trace.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.


Last edited by bruce2359 on Mon Aug 20, 2012 5:11 am; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 20, 2012 5:01 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
I would typically just code the app to attempt the reopen if I get a bad return code from the PUT, and likewise attempt the reconnect if I get a bad return code from the OPEN.




There's no need to connect / disconnect / open / close more than once in the life of an application. These are resource expensive operations and it's much cheaper to react to a problem.

mqjeff wrote:
We keep saying bad code because core dumps are not something that MQ typically does.


again

Well built (in the technical sense) applications don't produce core dumps. Certainly WMQ itself doesn't ever (or shouldn't ever!) produce one. Such dumps in my experience are bad compile scripts at work.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
steve_shad
PostPosted: Mon Aug 20, 2012 8:36 am    Post subject: Reply with quote

Newbie

Joined: 06 Aug 2012
Posts: 4

Thanks bruce2359, and other respondents. As I suspected, recoding is not necessarily the right way to go. To answer your questions :

bruce2359 wrote:
steve_shad wrote:

The module uses two input queues to read messages from, and a configurable number of queues on which to send replies.

How many configurable reply-to-queues? 5, 10, 100, 5000?

Configurable how?


There are 11 reply queues described in a database in our application.

bruce2359 wrote:

steve_shad wrote:
On startup, a connection is made to the appropraite queue managers,


The app MQCONNects to multiple queue managers concurrently? How many?


It looks like there is only 1.

bruce2359 wrote:


steve_shad wrote:
If any Put or Get operation on a queue fails, the queue is closed, queue manager disconnected and the queue marked as unavailable.

How is the queue marked as unavailable?


A class member variable in the app code.

bruce2359 wrote:


steve_shad wrote:


The MQ experts in our customer are suggesting we should recode our queue interface to connect/open the queue every time we use it.

Why are they suggesting this?


They say it is the "proper" way to do things. I wasn't convinced, hence the reason for contacting you Guys here again.

bruce2359 wrote:


steve_shad wrote:
Our application has been working this way for over 10 years, and problems of this type have not been seen until recently.

Are there any opinions out there ?

Obviously, something has changed. Get an MQ trace.


I will look into this.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » General IBM MQ Support » Is there any IBM MQ APIs to check the MQ connection status
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.