Writing and deploying IBM MQ .NET programs
To use IBM MQ classes for .NET to access IBM MQ queues, you write programs in any language supported by .NET containing calls that put messages onto, and get messages from, IBM MQ queues.
The IBM MQ documentation contains information only on the C#, C++ and Visual Basic languages.
This collection of topics provides information to assist with writing applications to interact with IBM MQ systems. For details of individual classes, see The IBM MQ .NET classes and interfaces.
- Connection differences
The way that you program for IBM MQ.NET has some dependencies on the connection modes that we want to use. - Use the IBM MQ .NET project template
The IBM MQ .NET client offers you the ability to use a project template to assist you in developing your .NET Core applications. - Configuration files for IBM MQ classes for .NET
A .NET client application can use an IBM MQ MQI client configuration file and, if we are using the managed connection type, a .NET application configuration file. Settings in the application configuration file have priority. - Example C# code fragment for use with .NET
A C# code fragment demonstrating that an application connects to a queue manager, puts a message on to a queue and receives a reply. - Set up the IBM MQ environment
Before we use the client connection to connect to a queue manager, we must set up the IBM MQ environment. - Connect to and disconnecting from a queue manager
When you have configured the IBM MQ environment, we are ready to connect to a queue manager. - Accessing queues and topics
We can access queues and topics using methods of MQQueueManager or appropriate constructors. - Handling messages
Messages are handled using the methods of the queue or topic classes. To build a new message, create a new MQMessageobject. - Handling errors
Handle errors arising from IBM MQ classes for .NET using try and catch blocks. - Getting and setting attribute values
The classes MQManagedObject, MQQueue, and MQQueueManager contain methods that allow you to get and set their attribute values. Note that for MQQueue, the methods work only if we specify the appropriate inquire and set flags when you open the queue. - Multithreaded programs
The .NET runtime environment is inherently multithreaded. IBM MQ classes for .NET allows a queue manager object to be shared across multiple threads but ensures that all access to the target queue manager is synchronized. - Use a client channel definition table with .NET
We can use a client channel definition table (CCDT) with the .NET classes for IBM MQ. You specify the location of the CCDT in different ways, depending on whether we are using a managed or unmanaged connection. - How a .NET application determines what channel definition to use
In the IBM MQ .NET client environment, the channel definition to be used can be specified in a number of different ways. Multiple specifications of the channel definition can exist. An application derives the channel definition from one or more sources. - Use channel exits in IBM MQ .NET
If we use client bindings, we can use channel exits as for any other client connection. If we use managed bindings, we must write an exit program that implements an appropriate interface. - Automatic client reconnection in .NET
We can make client reconnect automatically to a queue manager during an unexpected connection break. - Transport Layer Security (TLS) support for .NET
IBM MQ classes for .NET client applications support Transport Layer Security (TLS) encryption. The TLS protocol provides communications security over the internet, and allow client/server applications to communicate in a way that is confidential and reliable. - Use the .NET Monitor
The .NET Monitor is an application similar to an IBM MQ trigger monitor. - Compiling IBM MQ .NET programs
Specimen commands to compile .NET applications written in various languages. - Tracing IBM MQ .NET programs
In IBM MQ .NET, you start and control the trace facility as in IBM MQ programs using the MQI. - Use the stand-alone IBM MQ .NET client
From IBM MQ Version 8.0.0, Fix Pack 2, the IBM MQ .NET client offers you the ability to package and deploy an IBM MQ .NET assembly without needing to use the full IBM MQ client installation on production systems for running the applications.
Parent topic: Developing .NET applications