Constructors

MQQueueManager

public MQQueueManager(String queueManagerName)

Throws MQException.

Creates a connection to the named queue manager.

Note:
When using WebSphere MQ classes for .NET, the hostname, channel name, and port to use during the connection request are specified in the MQEnvironment class. This must be done before calling this constructor.

The following example shows a connection to a queue manager MYQM, running on a machine with hostname fred.mq.com.

MQEnvironment.Hostname = "fred.mq.com";  // host to connect to
MQEnvironment.Port     = 1414;           // port to connect to.
                                         // If I don't set this,
                                         // it defaults to 1414
                                         // (the default WebSphere MQ port)
MQEnvironment.Channel  = "channel.name"; // the CASE-SENSITIVE
                                         //  name of the
                                         // SVR CONN channel on
                                         // the queue manager
MQQueueManager qMgr    = new MQQueueManager("MYQM");

If the queue manager name is left blank (null or ""), a connection is made to the default queue manager.

See also MQEnvironment.

MQQueueManager

public MQQueueManager(String queueManagerName, 
                      int options)

Throws MQException.

This version of the constructor is intended for use only in bindings mode, that is, when connecting to a local server. It uses the extended connection API (MQCONNX) to connect to the queue manager. The options parameter allows you to choose fast or normal bindings. Possible values are:

  • MQC.MQCNO_FASTPATH_BINDING for fast bindings *.

  • MQC.MQCNO_STANDARD_BINDING for normal bindings.

MQQueueManager

public MQQueueManager(String queueManagerName,
                      Hashtable properties)

Throws MQException.

The properties parameter takes a series of key/value pairs that describe the WebSphere MQ environment for this particular queue manager. These properties, where specified, override the values set by the MQEnvironment class, and allow the individual properties to be set for any queue manager. The properties which may be specified are as follows:

  • MQC.CONNECT_OPTIONS_PROPERTY

  • MQC.CONNNAME_PROPERTY

  • MQC.HOST_NAME_PROPERTY

  • MQC.PORT_PROPERTY

  • MQC.CHANNEL_PROPERTY

  • MQC.SSL_CIPHER_SPEC_PROPERTY

  • MQC.SSL_PEER_NAME_PROPERTY

  • MQC.SSL_CERT_STORE_PROPERTY

  • MQC.SSL_CRYPTO_HARDWARE_PROPERTY

  • MQC.SECURITY_EXIT_PROPERTY

  • MQC.SECURITY_USERDATA_PROPERTY

  • MQC.SEND_EXIT_PROPERTY

  • MQC.SEND_USERDATA_PROPERTY

  • MQC.RECEIVE_EXIT_PROPERTY

  • MQC.RECEIVE_USERDATA_PROPERTY

  • MQC.MSG_EXIT_PROPERTY

  • MQC.USER_ID_PROPERTY

  • MQC.PASSWORD_PROPERTY

  • MQC.MQAIR_ARRAY

  • MQC.KEY_RESET_COUNT

  • MQC.FIPS_REQUIRED

  • MQC.HDR_CMP_LIST

  • MQC.MSG_CMP_LIST

  • MQC.TRANSPORT_PROPERTY

For descriptions of these properties, see the corresponding property description in MQEnvironment. Figure 5 shows an example of a program to create a queue manager with its user ID and password defined in a hash table.

Figure 5. Creating a hash table of properties.

Hashtable properties = new Hashtable();

properties.Add( MQC.USER_ID_PROPERTY, "ExampleUserId" );
properties.Add( MQC.PASSWORD_PROPERTY, "ExamplePassword" );

try
{
    mqQMgr = new MQQueueManager("qmgrname", properties);
}
catch (MQException mqe) 
{
    System.Console.WriteLine("Connect failed with " + mqe.Message);
    return((int)mqe.Reason);
}

MQQueueManager

public MQQueueManager(String queueManagerName, 
                      String channel, 
                      String connName)

Throws MQException.

Connects to the named Queue Manager, using the supplied 'Server Connection Channel' and connection.

MQQueueManager

public MQQueueManager(String queueManagerName,
                      Int options 
                      String channel, 
                      String connName)

Throws MQException.

Connects to the named Queue Manager, using the supplied 'Server Connection Channel' and connection, and passing the supplied options.


csqzav0567