Topic
  • 3 replies
  • Latest Post - ‏2012-12-13T18:21:15Z by SystemAdmin
SystemAdmin
SystemAdmin
8523 Posts

Pinned topic How to identify a connection to a queue manager with an app name in XMS?

‏2012-12-04T20:06:33Z |
One of the new features of MQ 7.5 is the ability to identify a connection to a queue manager by setting an application name.
The "What's new in WebSphere MQ Version 7.5" topic (http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fmq50095_.htm) in InfoCenter refers to another topic for setting up the environment class/object when using the WMQ classes for Java (if that's the language/API used to develop the client application).
I also found how to achieve the same result using the WMQ classes for JMS (http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fja11070_.htm).
Whether using JMS or the WMQ classes for Java, the key stop to identify a connection is basically setting a property in either the connection factory (if using JMS) or in the MQEnvironment or MQQueueManager (if using the WMQ classes for Java).
For JMS, the property is WMQ_APPLICATIONNAME, defined in com.ibm.msg.client.wmq.WMQConstants.
For the WMQ classes for Java, the constant is defined in MQConstants.APPNAME_PROPERTY.
However, there is no equivalent constant definition for the XMS interface.
Looking at the constant definition for WMQ_APPLICATIONNAME in com.ibm.msg.client.wmq.WMQConstants, I though that by just passing the string "XMSC_WMQ_APPNAME" as the property name, I would be able to gain the same functionally, but this doesn't work.

How can I identify a connection to a queue manager with an appplication name in XMS?
Updated on 2012-12-13T18:21:15Z at 2012-12-13T18:21:15Z by SystemAdmin
  • Shashikanth@BLR
    Shashikanth@BLR
    134 Posts

    Re: How to identify a connection to a queue manager with an app name in XMS?

    ‏2012-12-05T04:09:05Z  
    Name of the exe can be used to identify a XMS or C application. MQ Java/JMS has that property because all MQ Java/JMS applications used to have the same "WebSphere MQ Client for Java" application name. With that it was difficult to uniquely identify applications.
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: How to identify a connection to a queue manager with an app name in XMS?

    ‏2012-12-05T18:27:34Z  
    Name of the exe can be used to identify a XMS or C application. MQ Java/JMS has that property because all MQ Java/JMS applications used to have the same "WebSphere MQ Client for Java" application name. With that it was difficult to uniquely identify applications.
    While it is true that the path and name of the executable can be used to identify the application, it would be nice to have access to the same functionality provided by JMS or the MQ Classes for Java.
    Relying on the path and name of the executable is less than desirable when the developer does not have control over the installation directory or deployment procedure.
    My guess is that the XMS library (or one of its inner components) is able to set the application name anyway (hence the name of the exe appears as the app name), it's just that this feature needs to be exposed publicly. My guess is that even when the XMS library gets the XMSC_WMQ_APPNAME string as a connection factory's property, there's missing code that acts upon it.
    If anyone with deep knowledge of the internals of XMS could confirm this, it'd be much appreciated.
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: How to identify a connection to a queue manager with an app name in XMS?

    ‏2012-12-13T18:21:15Z  
    Seems like out team got confirmation from IBM that this is by design. They think that having the path+exe name is good enough, which is true for console/GUI apps. But when running as a DLL inside a Web app or a service (Windows or WCF), I don't think it actually helps. In this scenario (using XMS in a DLL), the support for the connection's ID is very similar to what used to be for JMS, meaning, the process name is fixed and you have no control over it.