- Here is a list of key terms about message queuing .TermDescriptionQueue managersThe queue manager is responsible for maintaining the queues it owns, and for storing all the messages it receives onto the appropriate queues.MessagesA message is a string of bytes that is meaningful to the applications that use it. Messages are used to transfer information from one application program to another. The applications can be running on the same or on different computers.Local queuesA local queue is a data structure used to store messages. The queue can be a normal queue or a transmission queue. A normal queue holds messages that are to be read by an application that is reading the message directly from the queue manager. A transmission queue holds messages that are in transit to another queue manager.Remote queuesA remote queue is used to address a message to another queue manager.ChannelsChannels are use to send and receive message between queue managers.ListenersListeners are processes that accept network requests from other queue managers, or client applications, and start associated channels.Creating a queue manager called QM11. Create a queue manager with the name QM1 by typing the following command:crtmqm QM1When the system creates the queue manager, you see the following output:C:\IBM\WebSphereMQ\bin>crtmqm QM1WebSphere MQ queue manager created.Directory 'C:\IBM\WebSphereMQ\qmgrs\QM1' created.The queue manager is associated with installation 'Installation1'.Creating or replacing default objects for queue manager 'QM1'.Default objects statistics : 77 created. 0 replaced. 0 failed.Completing setup.Setup completed.The queue manager is stopped. You must start the queue manager to administer it, and read and write messages from its queues.2. Start the queue manager by entering the following command:strmqm QM1When the queue manager successfully starts, you see the following output:C:\IBM\WebSphereMQ\bin>strmqm QM1WebSphere MQ queue manager 'QM1' starting.The queue manager is associated with installation 'Installation1'.5 log records accessed on queue manager 'QM1' during the log replay phase.Log replay for queue manager 'QM1' complete.Transaction manager state recovered for queue manager 'QM1'.WebSphere MQ queue manager 'QM1' started using V7.5.0.0.With the queue manager started, you can now create the queues.create a queue called LQ1A queue is a WebSphere MQ queue manager object. There are three ways to create WebSphere MQ objects:· Command-line.· WebSphere MQ Explorer.· Using a programmable interface.1. Start the scripting tool by typing the following command.runmqsc QM1When the scripting tool starts, you see:C:\IBM\WebSphereMQ\bin>runmqsc QM15724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.Starting MQSC for queue manager QM1.The tool is ready to accept MQSC commands.2. Create a local queue called LQ1 by typing the following MQSC command:define qlocal(LQ1)When the queue is created, you see the following output:define qlocal(LQ1)2 : define qlocal(LQ1)AMQ8006: WebSphere MQ queue created.3. Stop the scripting tool by typing the following MQSC command:endWhen the scripting tool ends, you see the following output:One MQSC command read.No commands have a syntax error.All valid MQSC commands were processed.C:\>Displaying Queue Manager StatusTo check the queue manager is running or not , type the following command: dspmqC:\IBM\WebSphereMQ\bin>dspmqQMNAME(QM1) STATUS(Running)Putting a message to the Queue LQ11. Use the amqsput sample application to put a message to queue LQ1 by typing: amqsput LQ1 QM1When the sample application starts, you see:C:\>amqsput LQ1 QM1Sample AMQSPUT0 starttarget queue is LQ1Type Hello World and press Enter. You placed a message that contains the text “Hello World” on the queue LQ1 managed by the queue manager called QM1. To end amqsput, press Enter.You see the following output:C:\>amqsput LQ1 QM1Sample AMQSPUT0 starttarget queue is LQ1Hello WorldSample AMQSPUT0 endGetting messages from the Queue LQ1Use the amqsget sample application to read a message on the queue LQ1 by typing: amqsget LQ1 QM1When the sample application starts, you see:C:\>amqsget LQ1 QM1Sample AMQSGET0 startmessage <Hello World>no more messagesSample AMQSGET0 endThe amqsget application ends 30 seconds after reading the message.Resources
This Blog contains Siva R Vaka's Notes related to latest technology discussions, various algorithms and solutions focusing mainly on AI (Artificial Intelligence) , ML (Machine Learning) & Data Science.
Websphere MQ Basics
Labels:
JAVA-J2EE,
JMS,
Websphere MQ
Subscribe to:
Post Comments (Atom)
Thanks for this. It's very useful.
ReplyDeletesuper
ReplyDeletecan you tell how to implement this using jms??
ReplyDelete