Skip to content

Latest commit

 

History

History
99 lines (48 loc) · 3.25 KB

README.md

File metadata and controls

99 lines (48 loc) · 3.25 KB

IBM MQ XMS samples

The XMS samples are based on the the existing samples shipped with IBM MQ Server and Client packages. These have been tested with .NET Framework 4.6 and Visual Studio Community 2017 v 15.9.5.

Download

Windows MQ client v 9.1.1.0 download

Reference the IBM.XMS library through Visual Studio Solution References option, right click and browse to [MQ default install location](C:\Program Files\IBM\MQ\bin\IBM.XMS.dll).

Reference from Visual Studio

Newtonsoft JSON package

Reference it through Solution Explorer NuGet Package installer

Rocket

We drive the running of all the samples through this one module that has the one main entry point in the project. Once you've built the project in Visual studio, you can run the project .exe on the command line from the project directory bin/debug location or bin/release depending on how you built it.

For example:

dotnet.exe put

Put / Get

Run

dotnet.exe put

In a separate terminal

dotnet.exe get

Publish / Subscribe

In the first terminal;

You have to run the subscriber sample first so it creates a subscription and waits for a publication.

Run

dotnet.exe sub

In the second terminal;

Run the publisher sample

dotnet.exe pub

Request / Response

In the first terminal;

Run the request sample

Run

dotnet.exe request

The request sample will put a message and wait for a response until it either gets a response or you ctrl+c interrupt it.

In the second terminal;

Run the response sample

Run

dotnet.exe response

The response sample will get a message from the queue, process it and put the response on the reply to queue and keep looking for more messages to respond to till you ctrl+c interrupt it.

Run the samples with TLS

If you are using a .NET managed client, then the underlying .NET framework will carry out the TLS handshake with the MQ Server. Any exceptions generated in the .NET layer during the TLS handshake will surface as server or queue not found - 2059.

To overcome this you need to import the client .p12 (or client side .kdb) certificate into Windows. Import it at either the user or the system level. Then in your app, set the key repository to either *USER or *SYSTEM depending on how you imported it.

For 'unmanaged' mode set KEY_REPOSITORY in your JSON file to the location of your key database / truststore

"KEY_REPOSITORY": "./keys/clientkey",

For 'managed' mode set KEY_REPOSITORY in your JSON file to

"KEY_REPOSITORY": "*USER",

or

"KEY_REPOSITORY": "*SYSTEM",

To find out how to import certificates on Windows, see How to: View certificates with the MMC snap-in and Import and Export Certificate - Microsoft Windows.