trindade.myphotos.cc Open in urlscan Pro
79.169.200.218  Public Scan

URL: https://trindade.myphotos.cc/lazysysadmin/2019/04/14/ibm-mq-basics-remote-queues-and-channels/
Submission: On December 28 via manual from AE — Scanned from PT

Form analysis 2 forms found in the DOM

<form id="commentform" class="comment-form">
  <iframe title="Comment Form"
    src="https://jetpack.wordpress.com/jetpack-comment/?blogid=155648049&amp;postid=103&amp;comment_registration=0&amp;require_name_email=1&amp;stc_enabled=1&amp;stb_enabled=1&amp;show_avatars=1&amp;avatar_default=mystery&amp;greeting=Leave+a+Reply&amp;jetpack_comments_nonce=386eb2c79a&amp;greeting_reply=Leave+a+Reply+to+%25s&amp;color_scheme=light&amp;lang=en_US&amp;jetpack_version=12.6.1&amp;show_cookie_consent=10&amp;has_cookie_consent=0&amp;token_key=%3Bnormal%3B&amp;sig=218644b6d5dd0e7a35951ba9a6dcfc5839ac1125#parent=https%3A%2F%2Ftrindade.myphotos.cc%2Flazysysadmin%2F2019%2F04%2F14%2Fibm-mq-basics-remote-queues-and-channels%2F"
    name="jetpack_remote_comment" style="width: 100%; height: 2px; border: 0px;" class="jetpack_remote_comment" id="jetpack_remote_comment" sandbox="allow-same-origin allow-top-navigation allow-scripts allow-forms allow-popups" scrolling="no">
  </iframe>
  <!--[if !IE]><!-->
  <script>
    document.addEventListener('DOMContentLoaded', function() {
      var commentForms = document.getElementsByClassName('jetpack_remote_comment');
      for (var i = 0; i < commentForms.length; i++) {
        commentForms[i].allowTransparency = false;
        commentForms[i].scrolling = 'no';
      }
    });
  </script>
  <!--<![endif]-->
</form>

GET https://trindade.myphotos.cc/lazysysadmin/

<form role="search" method="get" id="searchform" class="searchform" action="https://trindade.myphotos.cc/lazysysadmin/">
  <div>
    <label class="screen-reader-text" for="s">Search for:</label>
    <input type="text" value="" name="s" id="s">
    <input type="submit" id="searchsubmit" value="Search">
  </div>
</form>

Text Content

Lazy SysAdmin
Articles for Lazy Systems Administrators
Skip to content
 * Home

← IBM MQ basics: the first queue
IBM MQ basics: publish and subscribe →


IBM MQ BASICS: REMOTE QUEUES AND CHANNELS

Posted on April 14, 2019 by António Trindade

In the first install­ment of the IBM MQ Basics, avail­able here, I showed you
basic queue cre­ation and usage.

If IBM MQ would only allow local queues to be cre­at­ed and used, it would be
less use­ful. One of the strengths of IBM MQ is the abil­i­ty to link two or
more queue man­agers and send mes­sages to anoth­er queue manager.

In this arti­cle, I’m going to show you how to link two queue man­agers using a
remote queues and channels.



First of all, you need two dif­fer­ent queue man­agers. It does­n’t mat­ter if
they are in the same machine. I’m using two machines (actu­al­ly, two vir­tu­al
machines in my work machine, but the end result is absolute­ly the same).

I’m using the same queue man­ag­er that I con­fig­ured in the last arti­cle of
this series and anoth­er one, named QM2, with the same con­fig­u­ra­tion, that
is, a lis­ten­er named LISTENER.TCP, with trans­port type (TRPTYPE) TCP,
lis­te­nen­ing on port 1414 and a chan­nel for admin­is­tra­tion pur­pos­es of
type serv­er con­nec­tion (SVRCONN) name CLNT.ADM.


REMOTE QUEUES

A remote queue is a queue like any oth­er, with a few notable exceptions:

 * it is impos­si­ble to read from; it can only be writ­ten to;
 * it refers to anoth­er queue (remote, local, or alias) in anoth­er queue
   manager;
 * it does not occu­py any hard disk space, except for the space need­ed to
   store its definition;
 * you can (and should) spec­i­fy a trans­mis­sion queue (more on this type of
   queue later);


CHANNELS AND CHANNEL TYPES

Com­mu­ni­ca­tion between queue man­agers and between clients and queue
man­agers is always done using channels.

Chan­nels’ names can be at most 21 char­ac­ters long.

We’ve already talked about one type of chan­nel (the SVRCONN type). The
serv­er-con­nec­tion chan­nel is used for com­mu­ni­cat­ing between MQ client
appli­ca­tions and a queue manager.

The oth­er two types of chan­nels I am going to talk about now are the sender
chan­nel (SDR) and receiv­er chan­nel (RCVR) types.

As their name implies, the receiv­er chan­nel is used as the receiv­ing end of a
sender chan­nel. So, they always come in pairs.

The sender and receiv­er chan­nels must have the same name. That’s how a
send­ing queue man­ag­er iden­ti­fies the receiv­ing end.


TRANSMISSION QUEUES

Final­ly, one must define a trans­mis­sion queue before cre­at­ing a sender
channel.

This is a spe­cial type of local queue (you can write to and read from it,
although it is not advis­able) that serves as a tem­po­rary mes­sage store for
mes­sages being sent to a remote queue man­ag­er. If, for exam­ple, the remote
queue man­ag­er is down for some rea­son or the net­work con­nec­tion between
the two queue man­agers is not avail­able, the send­ing queue man­ag­er stores
the mes­sages des­tined to the remote one in this type of queue.

For each sender chan­nel you need cre­ate a trans­mis­sion queue.


PUTTING IT ALL TOGETHER


CONFIGURING QM1

Ok. Let ‘s start.

In the fol­low­ing exam­ple, I’m going to cre­ate a remote queue in the QM1
queue man­ag­er that refers to a local queue in the QM2 queue manager.

Begin­ning with the QM1 queue manager.

First, cre­ate a trans­mis­sion queue:

DEFINE QLOCAL(‘TO.QM2.X’) USAGE(XMITQ) TRIGGER TRIGDATA(TO.QM2) TRIGTYPE(FIRST)

This com­mand defines some­thing not dis­cussed above: trig­ger­ing. For now,
let me just say that the last three options enables auto start­ing the chan­nel
named TO.QM2 when a mes­sage is placed in the TO.QM2.XmitQ trans­mis­sion queue.

Next, we need to cre­ate a sender channel:

DEFINE CHANNEL(TO.QM2) CHLTYPE(SDR) CONNAME(‘mq2(1414)’) XMITQ(‘TO.QM2.X’)

This com­mand defines a sender chan­nel named TO.QM2 to host mq2, TCP port 1414
that uses the TO.QM2.XmitQ trans­mis­sion queue.

Final­ly, to wrap the con­fig­u­ra­tions in the QM1 queue man­ag­er, define the
Q2.W remote queue:

DEFINE QREMOTE(Q2.W) RQMNAME(QM2) RNAME(Q2.R) XMITQ(‘TO.QM2.X’)

This remote queue def­i­n­i­tion has a con­fig­u­ra­tion option which is not
wide­ly used: the option XMITQ. This option allows you to choose the sender
chan­nel which will be used by this remote queue by spec­i­fy­ing its
trans­mis­sion queue. If you do not spec­i­fy the trans­mis­sion queue used by a
remote one, the queue man­ag­er will choose an appro­pri­ate chan­nel to send
your mes­sages through.


CONFIGURING QM2

The con­fig­u­ra­tion for the QM2 queue man­ag­er is very simple.

First, define a local queue with the name of the RNAME option of the remote
queue you cre­at­ed in QM1 (Q2.R).

DEFINE QLOCAL(Q2.R)

Final­ly, define a receiv­er chan­nel with the same name of the sender chan­nel
defined in the QM1 queue manager.

DEFINE CHANNEL(TO.QM2) CHLTYPE(RCVR)


TESTING

In the mq1 machine run the fol­low­ing command

~$ /opt/mqm/samp/bin/amqsput Q2.W QM1
Sam­ple AMQSPUT0 start
tar­get queue is Q2.W
Hel­lo, World!
end
End of messages
Sam­ple AMQSPUT0 end

And, in the mq2 machine:

~$ /opt/mqm/samp/bin/amqsget Q2.R QM2
Sam­ple AMQSGET0 start
mes­sage <Hel­lo, World!>
mes­sage <end>
mes­sage <End of messages>
^C

That’s a wrap.

Stay tuned. In the next post, I’ll be talk­ing about the publish/subscribe
feature.

IBM MQ BASICS: THE FIRST QUEUE

Now that we've installed MQ, it's time to try it out. If you haven't read it,
you can go to Installing IBM MQ on Linux to learn how to do it. In this article,
I'll show you the basics of IBM MQ and what it can do for your applications'…

March 5, 2019

In "Middleware"

IBM MQ BASICS: PUBLISH AND SUBSCRIBE

In the first three articles of this series, I introduced you to IBM MQ and its
basic functionalities (queues, local and remote, channels and listeners). This
time, I'll start complicating things a bit. This time I'll write about the
publish and subscribe feature of IBM MQ. Overview Suppose you have…

July 12, 2019

With 1 comment

BASIC MQ COMMANDS

This should probably be my first blog post about MQ, but I confess: I was too
excited to start writing. Lately I've had little time to post new stuff. This is
probably just an excuse to write something again. In the following lines, I'll
give you an introduction to the…

November 28, 2021

In "Basics"

This entry was posted in MQ and tagged ibm mq, IBMMQ, middleware, mq, mqseries,
websphere mq, WebSphereMQ. Bookmark the permalink.
← IBM MQ basics: the first queue
IBM MQ basics: publish and subscribe →


ONE RESPONSE TO IBM MQ BASICS: REMOTE QUEUES AND CHANNELS

 1. Pingback: MQGem Monthly (May 2019) | MQGem Software

    


LEAVE A REPLYCANCEL REPLY


 * Search for:


 * RECENT POSTS
   
   * Basic MQ commands
   * IBM MQ basics: security — part 2: user authentication
   * IBM MQ basics: security — part 3: object permissions
   * IBM MQ basics: security — part 1: SSL communications
   * IBM MQ basics: publish and subscribe


 * RECENT COMMENTS
   
   * MQGem Monthly (December 2021) | MQGem Software on Basic MQ commands
   * António Trindade on IBM MQ installation in Linux
   * thanith on IBM MQ installation in Linux
   * MQGem Monthly (July 2019) | MQGem Software on IBM MQ basics: publish and
     subscribe
   * MQGem Monthly (May 2019) | MQGem Software on IBM MQ basics: remote queues
     and channels


 * ARCHIVES
   
   * November 2021
   * August 2020
   * August 2019
   * July 2019
   * April 2019
   * March 2019
   * February 2019
   * December 2018


 * CATEGORIES
   
   * Basics
   * General
   * Middleware
   * MQ
   * Security
   * Uncategorized


 * LINKS
   
    * Col­in Paice — MQ Blog
    * MQGem Home­page
    * MQGem Blog


 * META
   
   * Log in
   * Entries feed
   * Comments feed
   * WordPress.org

Lazy SysAdmin
Proudly powered by WordPress.