Use the XMS sample applications

The XMS .NET sample applications provide an overview of the common features of each API. We can use them to verify your installation and messaging server setup and to help you build your own applications.


For help to create your own applications, we can use the sample applications as a starting point. Both the source and a compiled version are provided for each application. Review the sample source code and identify the key steps to create each required object for the application (ConnectionFactory, Connection, Session, Destination, and a Producer, or a Consumer, or both), and to set any specific properties that are needed to specify how we want the application to work. For more information, see Writing XMS applications. The samples are subject to change in future releases of XMS.

The following table shows the sets of sample applications (one for each API) that are supplied with XMS.

Name of sample Description

SampleConsumerCS

A message consumer application that takes messages from a queue or subscribes to a topic.

SampleProducerCS

A message producer application that produces messages to a queue or on a topic.

SampleConfigCS

A configuration application used to create an administered object repository that is file-based. The application contains a connection factory and destination for your particular connection settings. This administered object repository can then be used with each of the sample consumer and producer applications.

The samples that support the same functions in the various APIs have syntactical differences.

  • The sample message consumer and producer applications both support the following functions:

    • Connections to IBM MQ, IBM Integration Bus (by using a real-time connection to a broker), and a WebSphere Application Server service integration bus
    • Administered object repository lookups by using the initial context interface
    • Connections to queues (IBM MQ and WebSphere Application Server service integration bus) and topics (IBM MQ, real-time connection to a broker, and WebSphere Application Server service integration bus)
    • Base, byte, map, object, stream, and text messages

  • The sample message consumer application supports synchronous and asynchronous receive modes, and SQL Selector statements.
  • The sample message producer application supports persistent and non-persistent delivery modes.

The samples can operate in one of two modes:

    Simple mode
    We can run the samples with the minimum user input.

    Advanced mode
    We can customize more finely the way in which the samples operate.

All the samples are compatible and can therefore operate across languages.

From Version 9.1.1, IBM MQ supports .NET Core for XMS .NET applications in Windows environments. IBM MQ classes for .NET Standard, including samples, are installed by default as part of the standard IBM MQ installation.

From Version 9.1.2, IBM MQ also supports .NET Core for applications in Linux environments.

The sample applications for XMS .NET are installed in &MQINSTALL_PATH&/samp/dotnet/samples/cs/core/xms.

For more information, see Use IBM MQ classes for XMS .NET Standard.

Parent topic: Developing XMS .NET applications