Set up the WebSphere MQ environment
Note:This step is not necessary when using WebSphere MQ classes for .NET in server bindings mode. In that case, go directly to Connecting to a queue manager. Before you use the client connection to connect to a queue manager, set up the MQEnvironment.The C based WebSphere MQ clients rely on environment variables to control the behavior of the MQCONN call. The .NET programming interface allows you to use the NMQ_MQ_LIB
customization value
but also includes a class MQEnvironment. This class allows you to specify the following details that are to be used during the connection attempt:
- Channel name
FIPS required
![]()
Header compression
![]()
- Host name
Key reset count
![]()
Message exit
![]()
Authentication information record array
![]()
Message data compression
![]()
Password
![]()
- Port number
Receive exit
![]()
Receive user data
![]()
Security exit
![]()
Security user data
![]()
Send exits
![]()
Send user data
![]()
- SSL cipher specification
- SSL cryptographic hardware
- SSL key repository
- SSL peer name
User ID
To specify the channel name and host name, use the following code:
MQEnvironment.Hostname = "host.domain.com"; MQEnvironment.Channel = "client.channel";By default, the clients attempt to connect to a WebSphere MQ listener at port 1414. To specify a different port, use the code:
MQEnvironment.Port = nnnn;
csqzav0532