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 IndexIBM MQ API SupportTCP Keepalives from an XMS application

Post new topicReply to topic Goto page 1, 2  Next
TCP Keepalives from an XMS application View previous topic :: View next topic
Author Message
damuka
PostPosted: Mon May 02, 2016 3:51 am Post subject: TCP Keepalives from an XMS application Reply with quote

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 doesnt work. Am I missing something? Please help.
If you know how to send heartbeats from an XMS.Net application, Im also interested.
My environment is MQ 7 server and MQ 8 client.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon May 02, 2016 4:14 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

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
View user's profile Send private message
damuka
PostPosted: Mon May 02, 2016 4:49 am Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Mon May 02, 2016 4:57 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

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
View user's profile Send private message
damuka
PostPosted: Mon May 02, 2016 7:16 am Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Mon May 02, 2016 7:17 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

mqjeff wrote:
KeepAlive tells MQ to use the OS level KeepAlive facility.

_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
damuka
PostPosted: Mon May 02, 2016 12:34 pm Post subject: Reply with quote

Newbie

Joined: 02 May 2016
Posts: 9

I'm not sure to understand what you mean. What should I do?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon May 02, 2016 12:38 pm Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

http://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.con.doc/q081900_.htm?lang=en
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
damuka
PostPosted: Mon May 02, 2016 12:57 pm Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Mon May 02, 2016 1:35 pm Post subject: Reply with quote

Poobah

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

Information on Keepalive on Linux:
http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/#whatis
_________________
I would tell you a UDP joke, but you might not get it.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Mon May 02, 2016 3:49 pm Post subject: Reply with quote

Jedi Council

Joined: 15 May 2001
Posts: 7380

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
View user's profile Send private message
hughson
PostPosted: Tue May 03, 2016 12:43 am Post subject: Reply with quote

Shaman

Joined: 09 May 2013
Posts: 730
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
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
damuka
PostPosted: Tue May 03, 2016 1:37 am Post subject: Reply with quote

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
View user's profile Send private message
hughson
PostPosted: Tue May 03, 2016 1:57 am Post subject: Reply with quote

Shaman

Joined: 09 May 2013
Posts: 730
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
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
damuka
PostPosted: Tue May 03, 2016 2:52 am Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum IndexIBM MQ API SupportTCP Keepalives from an XMS application
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.