SlideShare a Scribd company logo
1 of 10
Download to read offline
IBM MQ And C#-Sending And Receiving Messages
Introduction:
What is IBM MQ?
IBM MQ is messaging middleware that simplifies and accelerates the integration
of diverse applications and business data across multiple platforms. It uses
message queues to facilitate the exchange of information between applications,
systems, services and files and simplify the creation and maintenance of business
applications.
Benefits of IBM MQ
 Rapid, seamless connectivity: Offers a single, robust and trusted messaging
backbone for dynamic heterogeneous environments.
 Secure, reliable message delivery: Preserves message integrity and helps minimize
risk of information loss.
 Lower cost of ownership: Reduces cost of integration and accelerates time to
deployment.
Connecting to IBM MQ from C#.
Note:This document targets only windows platform.
Prerequisites:
 We need to install MQ client in order to connect with MQ server. I am using
MQv8 Client.
 You can download the client software from this link.
 If you follow normal installation path it will create folder in this path “C:Program
FilesIBMWebSphere MQ”.
Note: after installing WMQ client on windows platform, if the folder “SSL” does
not get created under {IBM MQ Installation directory}, create “SSL” folder
manually.
 Also you need to have following connection properties.
AMQCLCHL.TAB This is also called Client channel
definition table. This binary file
contains client connection details and
it shall be used to connect to Client.
KEY.ARM This is the queue manager certificate
and it shall be used by WMQ client
while connecting to Server queue
manager.
Hostname The TCP/IP hostname of the machine
on which the WebSphere MQ server
resides.
Port Number The port to be used.
Channel The name of the channel to connect to
on the target queue manager.
MQ Queue Name  Name of the Queue
Queue Manager Name  The name of the queue manager to
which to connect.
ClientID (UserID) The ID used to identify the WebSphere
MQ client
Password The password used to verify the
identity of the WebSphere MQ Client.
Cipher Spec application can establish a connection
to a queue manager depends on the
CipherSpec specified at the server end
of the MQI channel and the
CipherSuite specified at the client end.
Cipher Suite  The name of the Cipher Suite to be
used by SSL.
Setting up MQ client
To set up MQ client follow the below steps.
1. Copy AMQCLCHL.TAB and Key.arm file to the following path:
{Path of IBM MQ Installation directory}/SSL
2. Set the below values as “System Variables”
Variable name Value
MQCHLLIB {Path of IBM MQ Installation
directory}/SSL
MQCHLTAB AMQCLCHL.TAB
MQSSLKEYR {Path of IBM MQ Installation
directory}/SSL
3. Run the command prompt in administrator mode. Create a key database of
type CMS using command
runmqckm -keydb -create -db "C:Program FilesIBMWebSphere MQSSL key.kdb" -
pw password -type cms -expire 365 -stash
Here the password is of your choice and please remember this password as this is
needed in future.
Note: you can find more details about the options in the command in this link-
http://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q083860_.htm
4. Add the self signed certificate to key database using the below command.
runmqckm -cert -add -db " C:Program FilesIBMWebSphere MQSSLkey.kdb" -pw
password -label ibmwebspheremq<userID> -file " C:Program FilesIBMWebSphere
MQSSLkey.arm" -format ascii
where
password is the password you choose in the Step 3 when creating key
database of type CMS.
In ibmwebspheremq<userID> replace <userID> with client id. this is used as an
identifier.
Note: Specify the absolute path of the key.arm file.
5. check if the certificate is added successfully using the below command.
runmqckm -cert -list -db " C:Program FilesIBMWebSphere MQSSLkey.kdb " -pw
password
The output of above command must list the certificate
ibmwebspheremq<userID>
Now as the client is configured Let’s do coding.
Note: add reference to the dll amqmdnet.dll. you can find this dll in the MQ installation
directory (C:….)
In this sample application I am storing all the queue properties in my
app.config file.
<configuration>
<appSettings>
<add key="QueueManagerName" value=""/>
<add key="QueueName" value=""/>
<add key="ChannelName" value=""/>
<add key="TransportType" value="TCP"/>
<add key="HostName" value=""/>
<add key="Port" value=""/>
<add key="UserID" value=""/>
<add key="Password" value="YourChoice"/>
<add key="SSLCipherSpec" value="TLS_RSA_WITH_DES_CBC_SHA"/>
<add key="SSLKeyRepository" value="C:Program FilesIBMWebSphere MQsslkey"/>
</appSettings>
</configuration>
And I am using an Info class to fetch these details
public class MQInfo
{
public string QueueManagerName { get; set; }
public string QueueName { get; set; }
public string ChannelName { get; set; }
public string TransportType { get; set; }
public string HostName { get; set; }
public string Port { get; set; }
public string UserID { get; set; }
public string Password { get; set; }
public string SSLCipherSpec { get; set; }
public string SSLKeyRepository { get; set; }
public MQInfo()
{
QueueManagerName = ConfigurationManager.AppSettings["QueueManagerName"];
QueueName = ConfigurationManager.AppSettings["QueueName"];
ChannelName = ConfigurationManager.AppSettings["ChannelName"];
TransportType = ConfigurationManager.AppSettings["TransportType"];
HostName = ConfigurationManager.AppSettings["HostName"];
Port = ConfigurationManager.AppSettings["Port"];
UserID = ConfigurationManager.AppSettings["UserID"];
Password = ConfigurationManager.AppSettings["Password"];
SSLCipherSpec = ConfigurationManager.AppSettings["SSLCipherSpec"];
SSLKeyRepository = ConfigurationManager.AppSettings["SSLKeyRepository"];
}
}
MQHelper class will take care of reading and writing messages.
using IBM.WMQ;
namespace SampleApplication
{
public class MQHelper
{
MQQueueManager oQueueManager;
MQInfo oMQInfo;
void Main()
{
Console.WriteLine("1.Read Sample Messagen2.Write Sample Message");
var option = Convert.ToInt32(Console.ReadLine());
switch (option)
{
case 1: Connect();
var message = ReadSingleMessage();
Console.WriteLine(message);
break;
case 2: Connect();
message = "";
WriteMessage(message);
break;
default: Console.WriteLine("Invalid Option");
break;
}
Console.ReadLine();
}
private void Connect()
{
try
{
//get connection information
oMQInfo = new MQInfo();
//set the connection properties
MQEnvironment.Hostname = oMQInfo.HostName;
MQEnvironment.Port = Convert.ToInt32(oMQInfo.Port);
MQEnvironment.Channel = oMQInfo.ChannelName;
MQEnvironment.SSLCipherSpec = oMQInfo.SSLCipherSpec;
MQEnvironment.SSLKeyRepository = oMQInfo.SSLKeyRepository;
MQEnvironment.UserId = oMQInfo.UserID;
MQEnvironment.Password = oMQInfo.Password;
MQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES_CLIENT);
oQueueManager = new MQQueueManager(oMQInfo.QueueManagerName);
}
catch (Exception ex)
{
//Log exception
}
}
private string ReadSingleMessage()
{
string sResturnMsg = string.Empty;
try
{
if (oQueueManager != null && oQueueManager.IsConnected)
{
MQQueue oQueue = oQueueManager.AccessQueue(oMQInfo.QueueName,
MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);
MQMessage oMessage = new MQMessage();
oMessage.Format = MQC.MQFMT_STRING;
MQGetMessageOptions oGetMessageOptions = new
MQGetMessageOptions();
oQueue.Get(oMessage, oGetMessageOptions);
sResturnMsg = oMessage.ReadString(oMessage.MessageLength);
}
else
{
//Log the exception
sResturnMsg = string.Empty;
}
}
catch (MQException MQexp)
{
//Log the exception
sResturnMsg = string.Empty;
}
catch (Exception exp)
{
//Log the exception
sResturnMsg = string.Empty;
}
return sResturnMsg;
}
private void WriteMessage(string psMessage)
{
try
{
if (oQueueManager != null && oQueueManager.IsConnected)
{
MQQueue oQueue = oQueueManager.AccessQueue(oMQInfo.QueueName,
MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);
MQMessage oMessage = new MQMessage();
oMessage.WriteString(psMessage);
oMessage.Format = MQC.MQFMT_STRING;
MQPutMessageOptions oPutMessageOptions = new
MQPutMessageOptions();
oQueue.Put(oMessage, oPutMessageOptions);
}
else
{
//log exception
}
}
catch (MQException MQExp)
{
//log exception
}
catch (Exception ex)
{
//log exception
}
}
}
}
rfhutilc.exe can be used to place or view messages on the MQ remote queue.
You can download the utility from this location-
ftp://ftp.software.ibm.com/software/integration/support/supportpacs/individual
/ih03.zip
Conclusion:
In this article I have explained how we can connect to IBM MQ from C# and read
and write messages. Also I introduced rfhutilc.exe which can be used to place or
view messages on the MQ remote queue.

More Related Content

What's hot

IBM MQ: Using Publish/Subscribe in an MQ Network
IBM MQ: Using Publish/Subscribe in an MQ NetworkIBM MQ: Using Publish/Subscribe in an MQ Network
IBM MQ: Using Publish/Subscribe in an MQ NetworkDavid Ware
 
SSL Implementation - IBM MQ - Secure Communications
SSL Implementation - IBM MQ - Secure Communications SSL Implementation - IBM MQ - Secure Communications
SSL Implementation - IBM MQ - Secure Communications nishchal29
 
REST APIs and MQ
REST APIs and MQREST APIs and MQ
REST APIs and MQMatt Leming
 
MQ Guide France - IBM MQ and Containers
MQ Guide France - IBM MQ and ContainersMQ Guide France - IBM MQ and Containers
MQ Guide France - IBM MQ and ContainersRobert Parker
 
RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryMohammed Shaban
 
An Introduction to the Message Queuing Technology & IBM WebSphere MQ
An Introduction to the Message Queuing Technology & IBM WebSphere MQAn Introduction to the Message Queuing Technology & IBM WebSphere MQ
An Introduction to the Message Queuing Technology & IBM WebSphere MQRavi Yogesh
 
Custom Properties in InduSoft Web Studio
Custom Properties in InduSoft Web StudioCustom Properties in InduSoft Web Studio
Custom Properties in InduSoft Web StudioAVEVA
 
Websphere MQ (MQSeries) fundamentals
Websphere MQ (MQSeries) fundamentalsWebsphere MQ (MQSeries) fundamentals
Websphere MQ (MQSeries) fundamentalsBiju Nair
 
X Window System
X Window SystemX Window System
X Window SystemRon Bandes
 
IBM Websphere MQ Basic
IBM Websphere MQ BasicIBM Websphere MQ Basic
IBM Websphere MQ BasicPRASAD BHATKAR
 
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeIBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeDavid Ware
 
IBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use CasesIBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use CasesIBM DataPower Gateway
 
Angular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginAngular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginKaty Slemon
 
IBM MQ - better application performance
IBM MQ - better application performanceIBM MQ - better application performance
IBM MQ - better application performanceMarkTaylorIBM
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell ScriptingJaibeer Malik
 

What's hot (20)

IBM MQ: Using Publish/Subscribe in an MQ Network
IBM MQ: Using Publish/Subscribe in an MQ NetworkIBM MQ: Using Publish/Subscribe in an MQ Network
IBM MQ: Using Publish/Subscribe in an MQ Network
 
SSL Implementation - IBM MQ - Secure Communications
SSL Implementation - IBM MQ - Secure Communications SSL Implementation - IBM MQ - Secure Communications
SSL Implementation - IBM MQ - Secure Communications
 
REST APIs and MQ
REST APIs and MQREST APIs and MQ
REST APIs and MQ
 
MQ Guide France - IBM MQ and Containers
MQ Guide France - IBM MQ and ContainersMQ Guide France - IBM MQ and Containers
MQ Guide France - IBM MQ and Containers
 
Tomcat server
 Tomcat server Tomcat server
Tomcat server
 
RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client library
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
An Introduction to the Message Queuing Technology & IBM WebSphere MQ
An Introduction to the Message Queuing Technology & IBM WebSphere MQAn Introduction to the Message Queuing Technology & IBM WebSphere MQ
An Introduction to the Message Queuing Technology & IBM WebSphere MQ
 
WebSphere MQ tutorial
WebSphere MQ tutorialWebSphere MQ tutorial
WebSphere MQ tutorial
 
Custom Properties in InduSoft Web Studio
Custom Properties in InduSoft Web StudioCustom Properties in InduSoft Web Studio
Custom Properties in InduSoft Web Studio
 
Websphere MQ (MQSeries) fundamentals
Websphere MQ (MQSeries) fundamentalsWebsphere MQ (MQSeries) fundamentals
Websphere MQ (MQSeries) fundamentals
 
Active x control
Active x controlActive x control
Active x control
 
X Window System
X Window SystemX Window System
X Window System
 
IBM Websphere MQ Basic
IBM Websphere MQ BasicIBM Websphere MQ Basic
IBM Websphere MQ Basic
 
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeIBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
 
IBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use CasesIBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use Cases
 
Angular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginAngular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-login
 
IBM MQ - better application performance
IBM MQ - better application performanceIBM MQ - better application performance
IBM MQ - better application performance
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell Scripting
 
Linker scripts
Linker scriptsLinker scripts
Linker scripts
 

Viewers also liked

Bank of America Corporation acquires Merrill Lynch & Co., Inc. Presentation
Bank of America Corporation acquires Merrill Lynch & Co., Inc. PresentationBank of America Corporation acquires Merrill Lynch & Co., Inc. Presentation
Bank of America Corporation acquires Merrill Lynch & Co., Inc. PresentationQuarterlyEarningsReports3
 
Server consolidation with the Dell PowerEdge M620
Server consolidation with the Dell PowerEdge M620Server consolidation with the Dell PowerEdge M620
Server consolidation with the Dell PowerEdge M620Principled Technologies
 
XPS™ One™ Sales Aid (2007 2-page flyer)
XPS™ One™ Sales Aid (2007 2-page flyer)XPS™ One™ Sales Aid (2007 2-page flyer)
XPS™ One™ Sales Aid (2007 2-page flyer)Wayne Caswell
 
Workshop 1 - Associazione Italiana di Ingegneria Agraria - Monarca Danilo
Workshop 1 - Associazione Italiana di Ingegneria Agraria - Monarca DaniloWorkshop 1 - Associazione Italiana di Ingegneria Agraria - Monarca Danilo
Workshop 1 - Associazione Italiana di Ingegneria Agraria - Monarca DaniloRegioneLazio
 
Returns Management: Where are you on the Maturity Curve?
Returns Management: Where are you on the Maturity Curve?Returns Management: Where are you on the Maturity Curve?
Returns Management: Where are you on the Maturity Curve?Spinnaker Management Group
 
Industry Perspectives of SDN: Technical Challenges and Business Use Cases
Industry Perspectives of SDN: Technical Challenges and Business Use CasesIndustry Perspectives of SDN: Technical Challenges and Business Use Cases
Industry Perspectives of SDN: Technical Challenges and Business Use CasesOpen Networking Summits
 
Sun fire x4140, x4240, x4440 server customer presentation
Sun fire x4140, x4240, x4440 server customer presentationSun fire x4140, x4240, x4440 server customer presentation
Sun fire x4140, x4240, x4440 server customer presentationxKinAnx
 
dell 1996 Annual Report Cover Fiscal 1996 in
dell 1996 Annual Report Cover 	 Fiscal 1996 in dell 1996 Annual Report Cover 	 Fiscal 1996 in
dell 1996 Annual Report Cover Fiscal 1996 in QuarterlyEarningsReports3
 
Инвестиция в будущее: позвольте Dell представить вам мир ИТ-возможностей
Инвестиция в будущее: позвольте Dell представить вам мир ИТ-возможностейИнвестиция в будущее: позвольте Dell представить вам мир ИТ-возможностей
Инвестиция в будущее: позвольте Dell представить вам мир ИТ-возможностейNick Turunov
 
hp hc notification 2015
hp hc notification 2015hp hc notification 2015
hp hc notification 2015Raja Kashyap
 
Phat Resume 14Mar2016
Phat Resume 14Mar2016Phat Resume 14Mar2016
Phat Resume 14Mar2016Phat Ho
 
SOP - 2013 Server Build
SOP - 2013 Server BuildSOP - 2013 Server Build
SOP - 2013 Server BuildRobert Jones
 
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550Principled Technologies
 
Exchange server 2010规划与设计
Exchange server 2010规划与设计Exchange server 2010规划与设计
Exchange server 2010规划与设计popskf
 

Viewers also liked (20)

Bank of America Corporation acquires Merrill Lynch & Co., Inc. Presentation
Bank of America Corporation acquires Merrill Lynch & Co., Inc. PresentationBank of America Corporation acquires Merrill Lynch & Co., Inc. Presentation
Bank of America Corporation acquires Merrill Lynch & Co., Inc. Presentation
 
2012521131 박소영 io_t시대의ssca
2012521131 박소영 io_t시대의ssca2012521131 박소영 io_t시대의ssca
2012521131 박소영 io_t시대의ssca
 
Hand Key Manual
Hand Key ManualHand Key Manual
Hand Key Manual
 
Server consolidation with the Dell PowerEdge M620
Server consolidation with the Dell PowerEdge M620Server consolidation with the Dell PowerEdge M620
Server consolidation with the Dell PowerEdge M620
 
XPS™ One™ Sales Aid (2007 2-page flyer)
XPS™ One™ Sales Aid (2007 2-page flyer)XPS™ One™ Sales Aid (2007 2-page flyer)
XPS™ One™ Sales Aid (2007 2-page flyer)
 
I tube tr
I tube trI tube tr
I tube tr
 
Workshop 1 - Associazione Italiana di Ingegneria Agraria - Monarca Danilo
Workshop 1 - Associazione Italiana di Ingegneria Agraria - Monarca DaniloWorkshop 1 - Associazione Italiana di Ingegneria Agraria - Monarca Danilo
Workshop 1 - Associazione Italiana di Ingegneria Agraria - Monarca Danilo
 
Returns Management: Where are you on the Maturity Curve?
Returns Management: Where are you on the Maturity Curve?Returns Management: Where are you on the Maturity Curve?
Returns Management: Where are you on the Maturity Curve?
 
Industry Perspectives of SDN: Technical Challenges and Business Use Cases
Industry Perspectives of SDN: Technical Challenges and Business Use CasesIndustry Perspectives of SDN: Technical Challenges and Business Use Cases
Industry Perspectives of SDN: Technical Challenges and Business Use Cases
 
Sun fire x4140, x4240, x4440 server customer presentation
Sun fire x4140, x4240, x4440 server customer presentationSun fire x4140, x4240, x4440 server customer presentation
Sun fire x4140, x4240, x4440 server customer presentation
 
Los Valores
Los ValoresLos Valores
Los Valores
 
dell 1996 Annual Report Cover Fiscal 1996 in
dell 1996 Annual Report Cover 	 Fiscal 1996 in dell 1996 Annual Report Cover 	 Fiscal 1996 in
dell 1996 Annual Report Cover Fiscal 1996 in
 
Dell vs dabur
Dell vs daburDell vs dabur
Dell vs dabur
 
Инвестиция в будущее: позвольте Dell представить вам мир ИТ-возможностей
Инвестиция в будущее: позвольте Dell представить вам мир ИТ-возможностейИнвестиция в будущее: позвольте Dell представить вам мир ИТ-возможностей
Инвестиция в будущее: позвольте Dell представить вам мир ИТ-возможностей
 
hp hc notification 2015
hp hc notification 2015hp hc notification 2015
hp hc notification 2015
 
Praveen birla soft
Praveen birla softPraveen birla soft
Praveen birla soft
 
Phat Resume 14Mar2016
Phat Resume 14Mar2016Phat Resume 14Mar2016
Phat Resume 14Mar2016
 
SOP - 2013 Server Build
SOP - 2013 Server BuildSOP - 2013 Server Build
SOP - 2013 Server Build
 
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
 
Exchange server 2010规划与设计
Exchange server 2010规划与设计Exchange server 2010规划与设计
Exchange server 2010规划与设计
 

Similar to Ibm mq with c# sending and receiving messages

IBM Informix dynamic server and websphere MQ integration
IBM Informix dynamic server and websphere MQ  integrationIBM Informix dynamic server and websphere MQ  integration
IBM Informix dynamic server and websphere MQ integrationKeshav Murthy
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-serviceshomeworkping3
 
IBM MQ Security Deep Dive
IBM MQ Security Deep DiveIBM MQ Security Deep Dive
IBM MQ Security Deep DiveIBM Systems UKI
 
MQTC 2016 - IBM MQ Security: Overview & recap
MQTC 2016 - IBM MQ Security: Overview & recapMQTC 2016 - IBM MQ Security: Overview & recap
MQTC 2016 - IBM MQ Security: Overview & recapRobert Parker
 
ESM v5.0 Service Layer Developer's Guide
ESM v5.0 Service Layer Developer's GuideESM v5.0 Service Layer Developer's Guide
ESM v5.0 Service Layer Developer's GuideProtect724
 
ESM v5.0 Service Layer Developer's Guide
ESM v5.0 Service Layer Developer's GuideESM v5.0 Service Layer Developer's Guide
ESM v5.0 Service Layer Developer's GuideProtect724
 
HHM 6887 Managing Your Scalable Applications in an MQ Hybrid Cloud World
HHM 6887 Managing Your Scalable Applications in an MQ Hybrid Cloud WorldHHM 6887 Managing Your Scalable Applications in an MQ Hybrid Cloud World
HHM 6887 Managing Your Scalable Applications in an MQ Hybrid Cloud Worldmatthew1001
 
Secure Messages with IBM WebSphere MQ Advanced Message Security
Secure Messages with IBM WebSphere MQ Advanced Message SecuritySecure Messages with IBM WebSphere MQ Advanced Message Security
Secure Messages with IBM WebSphere MQ Advanced Message SecurityMorag Hughson
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitDanilo Poccia
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureMikhail Prudnikov
 
PRIVATE CLOUD SERVER IMPLEMENTATIONS FOR DATA STORAGE
PRIVATE CLOUD SERVER IMPLEMENTATIONS FOR DATA STORAGEPRIVATE CLOUD SERVER IMPLEMENTATIONS FOR DATA STORAGE
PRIVATE CLOUD SERVER IMPLEMENTATIONS FOR DATA STORAGEEditor IJCTER
 
Cohesive Networks Support Docs: VNS3 version 3.5+ API Guide
Cohesive Networks Support Docs: VNS3 version 3.5+ API Guide Cohesive Networks Support Docs: VNS3 version 3.5+ API Guide
Cohesive Networks Support Docs: VNS3 version 3.5+ API Guide Cohesive Networks
 
Apache cassandra - future without boundaries (part3)
Apache cassandra - future without boundaries (part3)Apache cassandra - future without boundaries (part3)
Apache cassandra - future without boundaries (part3)Return on Intelligence
 
Using Apache as an Application Server
Using Apache as an Application ServerUsing Apache as an Application Server
Using Apache as an Application ServerPhil Windley
 
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션Amazon Web Services Korea
 
Secure Management of Fleet at Scale
Secure Management of Fleet at ScaleSecure Management of Fleet at Scale
Secure Management of Fleet at ScaleAmazon Web Services
 
Cloud Foundry a Developer's Perspective
Cloud Foundry a Developer's PerspectiveCloud Foundry a Developer's Perspective
Cloud Foundry a Developer's PerspectiveDave McCrory
 

Similar to Ibm mq with c# sending and receiving messages (20)

IBM Informix dynamic server and websphere MQ integration
IBM Informix dynamic server and websphere MQ  integrationIBM Informix dynamic server and websphere MQ  integration
IBM Informix dynamic server and websphere MQ integration
 
WCF Fundamentals
WCF Fundamentals WCF Fundamentals
WCF Fundamentals
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services
 
Jms tutor
Jms tutorJms tutor
Jms tutor
 
IBM MQ Security Deep Dive
IBM MQ Security Deep DiveIBM MQ Security Deep Dive
IBM MQ Security Deep Dive
 
IBM MQ V8 Security
IBM MQ V8 SecurityIBM MQ V8 Security
IBM MQ V8 Security
 
MQTC 2016 - IBM MQ Security: Overview & recap
MQTC 2016 - IBM MQ Security: Overview & recapMQTC 2016 - IBM MQ Security: Overview & recap
MQTC 2016 - IBM MQ Security: Overview & recap
 
ESM v5.0 Service Layer Developer's Guide
ESM v5.0 Service Layer Developer's GuideESM v5.0 Service Layer Developer's Guide
ESM v5.0 Service Layer Developer's Guide
 
ESM v5.0 Service Layer Developer's Guide
ESM v5.0 Service Layer Developer's GuideESM v5.0 Service Layer Developer's Guide
ESM v5.0 Service Layer Developer's Guide
 
HHM 6887 Managing Your Scalable Applications in an MQ Hybrid Cloud World
HHM 6887 Managing Your Scalable Applications in an MQ Hybrid Cloud WorldHHM 6887 Managing Your Scalable Applications in an MQ Hybrid Cloud World
HHM 6887 Managing Your Scalable Applications in an MQ Hybrid Cloud World
 
Secure Messages with IBM WebSphere MQ Advanced Message Security
Secure Messages with IBM WebSphere MQ Advanced Message SecuritySecure Messages with IBM WebSphere MQ Advanced Message Security
Secure Messages with IBM WebSphere MQ Advanced Message Security
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless Architecture
 
PRIVATE CLOUD SERVER IMPLEMENTATIONS FOR DATA STORAGE
PRIVATE CLOUD SERVER IMPLEMENTATIONS FOR DATA STORAGEPRIVATE CLOUD SERVER IMPLEMENTATIONS FOR DATA STORAGE
PRIVATE CLOUD SERVER IMPLEMENTATIONS FOR DATA STORAGE
 
Cohesive Networks Support Docs: VNS3 version 3.5+ API Guide
Cohesive Networks Support Docs: VNS3 version 3.5+ API Guide Cohesive Networks Support Docs: VNS3 version 3.5+ API Guide
Cohesive Networks Support Docs: VNS3 version 3.5+ API Guide
 
Apache cassandra - future without boundaries (part3)
Apache cassandra - future without boundaries (part3)Apache cassandra - future without boundaries (part3)
Apache cassandra - future without boundaries (part3)
 
Using Apache as an Application Server
Using Apache as an Application ServerUsing Apache as an Application Server
Using Apache as an Application Server
 
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
 
Secure Management of Fleet at Scale
Secure Management of Fleet at ScaleSecure Management of Fleet at Scale
Secure Management of Fleet at Scale
 
Cloud Foundry a Developer's Perspective
Cloud Foundry a Developer's PerspectiveCloud Foundry a Developer's Perspective
Cloud Foundry a Developer's Perspective
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 

Ibm mq with c# sending and receiving messages

  • 1. IBM MQ And C#-Sending And Receiving Messages Introduction: What is IBM MQ? IBM MQ is messaging middleware that simplifies and accelerates the integration of diverse applications and business data across multiple platforms. It uses message queues to facilitate the exchange of information between applications, systems, services and files and simplify the creation and maintenance of business applications. Benefits of IBM MQ  Rapid, seamless connectivity: Offers a single, robust and trusted messaging backbone for dynamic heterogeneous environments.  Secure, reliable message delivery: Preserves message integrity and helps minimize risk of information loss.  Lower cost of ownership: Reduces cost of integration and accelerates time to deployment. Connecting to IBM MQ from C#. Note:This document targets only windows platform. Prerequisites:  We need to install MQ client in order to connect with MQ server. I am using MQv8 Client.  You can download the client software from this link.  If you follow normal installation path it will create folder in this path “C:Program FilesIBMWebSphere MQ”. Note: after installing WMQ client on windows platform, if the folder “SSL” does not get created under {IBM MQ Installation directory}, create “SSL” folder manually.
  • 2.  Also you need to have following connection properties. AMQCLCHL.TAB This is also called Client channel definition table. This binary file contains client connection details and it shall be used to connect to Client. KEY.ARM This is the queue manager certificate and it shall be used by WMQ client while connecting to Server queue manager. Hostname The TCP/IP hostname of the machine on which the WebSphere MQ server resides. Port Number The port to be used. Channel The name of the channel to connect to on the target queue manager. MQ Queue Name  Name of the Queue Queue Manager Name  The name of the queue manager to which to connect. ClientID (UserID) The ID used to identify the WebSphere MQ client Password The password used to verify the identity of the WebSphere MQ Client. Cipher Spec application can establish a connection to a queue manager depends on the CipherSpec specified at the server end of the MQI channel and the CipherSuite specified at the client end. Cipher Suite  The name of the Cipher Suite to be used by SSL.
  • 3. Setting up MQ client To set up MQ client follow the below steps. 1. Copy AMQCLCHL.TAB and Key.arm file to the following path: {Path of IBM MQ Installation directory}/SSL 2. Set the below values as “System Variables” Variable name Value MQCHLLIB {Path of IBM MQ Installation directory}/SSL MQCHLTAB AMQCLCHL.TAB MQSSLKEYR {Path of IBM MQ Installation directory}/SSL 3. Run the command prompt in administrator mode. Create a key database of type CMS using command runmqckm -keydb -create -db "C:Program FilesIBMWebSphere MQSSL key.kdb" - pw password -type cms -expire 365 -stash Here the password is of your choice and please remember this password as this is needed in future. Note: you can find more details about the options in the command in this link- http://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q083860_.htm
  • 4. 4. Add the self signed certificate to key database using the below command. runmqckm -cert -add -db " C:Program FilesIBMWebSphere MQSSLkey.kdb" -pw password -label ibmwebspheremq<userID> -file " C:Program FilesIBMWebSphere MQSSLkey.arm" -format ascii where password is the password you choose in the Step 3 when creating key database of type CMS. In ibmwebspheremq<userID> replace <userID> with client id. this is used as an identifier. Note: Specify the absolute path of the key.arm file.
  • 5. 5. check if the certificate is added successfully using the below command. runmqckm -cert -list -db " C:Program FilesIBMWebSphere MQSSLkey.kdb " -pw password The output of above command must list the certificate ibmwebspheremq<userID> Now as the client is configured Let’s do coding. Note: add reference to the dll amqmdnet.dll. you can find this dll in the MQ installation directory (C:….) In this sample application I am storing all the queue properties in my app.config file. <configuration> <appSettings> <add key="QueueManagerName" value=""/> <add key="QueueName" value=""/> <add key="ChannelName" value=""/> <add key="TransportType" value="TCP"/>
  • 6. <add key="HostName" value=""/> <add key="Port" value=""/> <add key="UserID" value=""/> <add key="Password" value="YourChoice"/> <add key="SSLCipherSpec" value="TLS_RSA_WITH_DES_CBC_SHA"/> <add key="SSLKeyRepository" value="C:Program FilesIBMWebSphere MQsslkey"/> </appSettings> </configuration> And I am using an Info class to fetch these details public class MQInfo { public string QueueManagerName { get; set; } public string QueueName { get; set; } public string ChannelName { get; set; } public string TransportType { get; set; } public string HostName { get; set; } public string Port { get; set; } public string UserID { get; set; } public string Password { get; set; } public string SSLCipherSpec { get; set; } public string SSLKeyRepository { get; set; } public MQInfo() { QueueManagerName = ConfigurationManager.AppSettings["QueueManagerName"]; QueueName = ConfigurationManager.AppSettings["QueueName"]; ChannelName = ConfigurationManager.AppSettings["ChannelName"]; TransportType = ConfigurationManager.AppSettings["TransportType"]; HostName = ConfigurationManager.AppSettings["HostName"]; Port = ConfigurationManager.AppSettings["Port"]; UserID = ConfigurationManager.AppSettings["UserID"]; Password = ConfigurationManager.AppSettings["Password"]; SSLCipherSpec = ConfigurationManager.AppSettings["SSLCipherSpec"]; SSLKeyRepository = ConfigurationManager.AppSettings["SSLKeyRepository"]; } } MQHelper class will take care of reading and writing messages. using IBM.WMQ; namespace SampleApplication {
  • 7. public class MQHelper { MQQueueManager oQueueManager; MQInfo oMQInfo; void Main() { Console.WriteLine("1.Read Sample Messagen2.Write Sample Message"); var option = Convert.ToInt32(Console.ReadLine()); switch (option) { case 1: Connect(); var message = ReadSingleMessage(); Console.WriteLine(message); break; case 2: Connect(); message = ""; WriteMessage(message); break; default: Console.WriteLine("Invalid Option"); break; } Console.ReadLine(); } private void Connect() { try { //get connection information oMQInfo = new MQInfo(); //set the connection properties MQEnvironment.Hostname = oMQInfo.HostName; MQEnvironment.Port = Convert.ToInt32(oMQInfo.Port); MQEnvironment.Channel = oMQInfo.ChannelName; MQEnvironment.SSLCipherSpec = oMQInfo.SSLCipherSpec; MQEnvironment.SSLKeyRepository = oMQInfo.SSLKeyRepository; MQEnvironment.UserId = oMQInfo.UserID; MQEnvironment.Password = oMQInfo.Password; MQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT); oQueueManager = new MQQueueManager(oMQInfo.QueueManagerName); } catch (Exception ex) { //Log exception }
  • 8. } private string ReadSingleMessage() { string sResturnMsg = string.Empty; try { if (oQueueManager != null && oQueueManager.IsConnected) { MQQueue oQueue = oQueueManager.AccessQueue(oMQInfo.QueueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING); MQMessage oMessage = new MQMessage(); oMessage.Format = MQC.MQFMT_STRING; MQGetMessageOptions oGetMessageOptions = new MQGetMessageOptions(); oQueue.Get(oMessage, oGetMessageOptions); sResturnMsg = oMessage.ReadString(oMessage.MessageLength); } else { //Log the exception sResturnMsg = string.Empty; } } catch (MQException MQexp) { //Log the exception sResturnMsg = string.Empty; } catch (Exception exp) { //Log the exception sResturnMsg = string.Empty; } return sResturnMsg; } private void WriteMessage(string psMessage) { try { if (oQueueManager != null && oQueueManager.IsConnected) { MQQueue oQueue = oQueueManager.AccessQueue(oMQInfo.QueueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING); MQMessage oMessage = new MQMessage(); oMessage.WriteString(psMessage); oMessage.Format = MQC.MQFMT_STRING; MQPutMessageOptions oPutMessageOptions = new MQPutMessageOptions(); oQueue.Put(oMessage, oPutMessageOptions);
  • 9. } else { //log exception } } catch (MQException MQExp) { //log exception } catch (Exception ex) { //log exception } } } }
  • 10. rfhutilc.exe can be used to place or view messages on the MQ remote queue. You can download the utility from this location- ftp://ftp.software.ibm.com/software/integration/support/supportpacs/individual /ih03.zip Conclusion: In this article I have explained how we can connect to IBM MQ from C# and read and write messages. Also I introduced rfhutilc.exe which can be used to place or view messages on the MQ remote queue.