Author |
Message
|
damuka |
Posted: Mon May 02, 2016 3:51 am Post subject: TCP Keepalives from an XMS application |
|
|
Newbie
Joined: 02 May 2016 Posts: 9
|
In order to verify if an MQ Server is still available, I would like to initiate KeepAlive probes from an XMS application.
In the client configuration file (mqclient.ini), I have set the KeepAlive attribute to YES but it doesn’t work. Am I missing something? Please help.
If you know how to send heartbeats from an XMS.Net application, I’m also interested.
My environment is MQ 7 server and MQ 8 client. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon May 02, 2016 4:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
KeepAlive tells MQ to use the OS level KeepAlive facility.
Is there a reason outside the logic/requirements of your program that you actually need keepalive?
Do you need to make sure you maintain a connection, because of networking/firewall/other reasons?
If there isn't a reason outside your program's logic/requirements, you should simply implement reconnect logic instead. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
damuka |
Posted: Mon May 02, 2016 4:49 am Post subject: |
|
|
Newbie
Joined: 02 May 2016 Posts: 9
|
I need to use keepalive because I noticed network failures that aren't detected by the connection's exception listener. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon May 02, 2016 4:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Well. That likely means that the connection closed without being in an Exception condition. Maybe timed out...
You might also not get exceptions on the connection, once the connection is established. You might just get exceptions trying to use the connection for something - get, put, (send/receive), pub, sub, open, etc. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
damuka |
Posted: Mon May 02, 2016 7:16 am Post subject: |
|
|
Newbie
Joined: 02 May 2016 Posts: 9
|
Thank you for the information.
Do you know how I can activate these keepalive probes? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon May 02, 2016 7:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mqjeff wrote: |
KeepAlive tells MQ to use the OS level KeepAlive facility. |
_________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
damuka |
Posted: Mon May 02, 2016 12:34 pm Post subject: |
|
|
Newbie
Joined: 02 May 2016 Posts: 9
|
I'm not sure to understand what you mean. What should I do? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon May 02, 2016 12:38 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
damuka |
Posted: Mon May 02, 2016 12:57 pm Post subject: |
|
|
Newbie
Joined: 02 May 2016 Posts: 9
|
I've been able to send keepalive probes from the MQ server to the MQ client. What I would like to do is to send keepalive probes from the MQ client to the MQ Server. I can't find the info on this link.
Could you point out exactly which paragraph I should read ? |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon May 02, 2016 1:35 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon May 02, 2016 3:49 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
When you need to call your friend on the phone, do you call him, tell him you were checking to see if he would answer, then hang up and call right back to actually start the conversation?
No, when you need to talk to him, and only then, you call. If he answers, you talk, if he does not answer, you deal with it.
Same thing for your MQ connections. It is pointless to check if the server responds before trying your real work, because one micorsecond after you get a response that the server is up, the server can crash. This type of checking is a pure waste of CPU cycles - it accomplishes nothing positive. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
hughson |
Posted: Tue May 03, 2016 12:43 am Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
If your aim is to have the MQ client more quickly detect network failures then keep alive isn't your only option with modern versions of MQ. By modern in this context I mean V7 or newer. In these versions, which you are using, you can enable client heartbeats which are sent at all times during the conversation and not only when the application does a get-wait as was the case pre-V7.
Look into setting the HBINT attribute on both client and SVRCONN.
Cheers
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
damuka |
Posted: Tue May 03, 2016 1:37 am Post subject: |
|
|
Newbie
Joined: 02 May 2016 Posts: 9
|
Hi Morag,
Could you please explain me how I can set the HBINT attribute in a XMS application?
Thank you in advance. |
|
Back to top |
|
 |
hughson |
Posted: Tue May 03, 2016 1:57 am Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
The answer rather depends on how you are setting your other channel attributes.
For example, if you are setting them using a CCDT, then you would set HBINT in a CCDT as well. This btw is the recommended approach.
If you are coding them directly you need to code this directly too, etc etc.
So, to answer it, can you first say how you are setting your other client channel attributes, e.g, channel name, hostname etc?
Also, you should check whether you need to change anything at all by DISPLAY CHSTATUS while the application is running and view HBINT there, and also tell us what the HBINT is when you DISPLAY CHANNEL on your SVRCONN.
Cheers
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
damuka |
Posted: Tue May 03, 2016 2:52 am Post subject: |
|
|
Newbie
Joined: 02 May 2016 Posts: 9
|
I'm setting other client channel attributes directly in the code.
I don't have access to the MQ server and I have received any CCDT file from the MQ server admin. From what I'm seeing in Wireshark the MQ server sends HEARTBEAT to the MQ client every 5 minutes so its value must be 300. |
|
Back to top |
|
 |
|