2. WebSphere MQ - illyfrancis/scribble GitHub Wiki

Overview

Documentations

Notes

MQ & Transaction
MQ & reply to, acknowledgement
Random stuff
  • Explanation on Activation specification - here and here
  • WMQ Queue Manager concept, is not avail in ActiveMQ - refer to thread
  • ActiveMQ broker is sort of equivalent
  • WebSphere MQ Explorer - shipped with MQ product, Eclipse based
  • Management & monitoring
    1. via text commands - aka WebSphere MQ script commands (MQSC) into a console or scripting environment
      • e.g. command creates a queue with specified attributes DEFINE QLOCAL(MY.QUEUE) DESCR("Teest Queue") DEFPSIST(YES)
    2. Programmatic control is done with WebSphere MQ messages are sent to, or read from, well-known queues. The messages have documented formats, called the programmable command format (PCF), and many tools and products exist to create and use them.
Tutorials
Topology?
  • Queue
  • Queue Manager
  • Queue Manager Cluster
What about WebSphere Message Broker?

MQ Primer

Messages

  • Cosists of three parts
    1. MQ message descriptor (MQMD)
      • among many other fields, persistence flag selects whether the message must be treated as persistent and therefore recoverable in a system failure or if the message is non-persistent and can be discarded when an error occurs.
        • a programmer can explicitly set persistence to be on or off or allow the value to be controlled by a system administrator
        • Queues can hold a combination of persistent and non-persistent messages
    2. Message properties (optional)
      • most commonly used in publish/subscriptions to provide an additional layer of selection beyond just the topic - similar to an SQL query using the where clause
    3. Message data - limited to 100MB

WebSphere MQ objects

  • Example types:
    1. Queues
    2. Channels
    3. Topics
    4. Queue Manager
    5. and more (there are 12 types of objects)
  • Objects have names up to 48 chars long (20 chars for channels) and case-sensitive
  • A queue called queue.abc is different from a queue called QUEUE.ABC - and both of these can be defined on a queue manager, but shouldn't because it's confusing.
  • Objects have attributes or properties that define the behaviour when they are used
  • Some objects have subtypes, which have different sets of props. e.g. the CONNAME is an attribute of SENDER channels but not of RECEIVER channel
Queues
  • Types
    • Local queue - only place where message are physically stored. all other queue types must be defined to point at a local queue
    • Alias queue - a pointer to a local queue (usually) for convenience for a different applications to use diff names for the same real queue. Alias queue can be used as a pointer to a topic for publish/subscribe applications
    • Remote queue - another type of pointer. the remote queue definition describes a queue on another queue manager. Application cannot read messages from remote queues
    • Model queue - a template, can be used by an application to dynamically create a real queue. often used to create a unique queue for reply messages and then the queue is automatically deleted when the application ends.
    • Dynamic queue - these queues are created by the process of opening a model queue. They are real queues but cannot be explicitly created through admin interfaces.
      • Two types:
        1. temporary dynamic queue (TDQ) - automatically deleted when the application that caused it to be created ends
        2. permanent dynamic queue (PDQ) - survives the creating application and can be reused by another application
  • No such thing as persistent queues or non-persistent queues (with one exception)
    • Queues can hold both persistent and non-persistent messages, although they have an attribute to define the default persistence value for messages put to them if the application does not explicitly set the value.
    • Exception is TDQ that can only be used for non-persistent messages.
  • Special queues
    • Transmission queue - is a local queue with the USAGE(XMITQ) attribute configured. a staging point for messages that are destined for a remote queue manager (read more)
    • Initiation queue - a local queue to which the queue manager writes a trigger message when certain conditions are met on another local queue
    • Dead-letter queue
      • (DLQ) is usually defined when a queue manager is created. used for situations when a queue manager cannot deliver a message across a channel, some examples:
        • destination queue is full
        • destination queue does not exist
        • message puts have been inhibited on the destination queue
        • sender is not authorized to use the destination queue
        • message is too large
      • a queue manager has at most one DLQ
      • if an application putting a message receives an error that indicates the output queue is full, the message is not put to a DLQ. the message is never accepted by the queue manager for processing (when would this happen?)
    • Event queue - the queue manager generates event messages when certain things happen. E.g. when a queue is nearly full or when an application is not authorized to open a queue. These event messages are written to one of the predefined event queues and can then be processed by management tools. All event queues have similar names that indicate the type of event that is held there.
      • SYSTEM.ADMIN.QMGR.EVENT or SYSTEM.ADMIN.CHANNEL.EVENT - examples of queue manager event queues
    • Cluster queue - a local queue that is configured to advertise its existence withing a WebSphere MQ cluster. Applications can refer to this queue without needing any additional definitions and all the queue mangers in the cluster know how to route messages to it. Usually there are multiple cluster queues of the same name within the cluster.The sending queue manager selects which cluster queue to use based on a workload balancing algorithm
Topic objects
  • only since WebSphere MQ v7.0
  • character string describes the nature of the data that is published in a pub/sub system
  • Instead of including a specific destination address in each message, a publisher assigns a topic to the message
  • The queue manager matches the topic with a list of subscribers and delivers a copy of the published message to each of those subscribers
  • usually choose the topics that fit into a hierarchical tree structure - helps with establishing security policies and makes it easy for applications to subscribe to multiple topics in a single step
  • topic objects represent a subset of the topics that are used by applications
  • read more ...
Channels
  • Logical communication link, two types in WMQ
    1. Message channels
      • connects two queue managers via message channel agents (MCAs)
      • unidirectional, only sent in one direction along the channel
      • ...
      • typical network protocol is TCP/IP
    2. MQI channels
      • connects a WebSphere MQ Client to a queue manager across a network
      • bidirectional
  • For two-way messaging between queue managers, there are usually two symmetric pairs of message channels defined.
  • Channels are usually configured to start automatically when messages are available on the associated transmission queue. This feature uses trigger attributes that are set on the transmission queue
  • When a WebSphere MQ cluster is in use, not necessary to manually define the channels
  • Listeners
    • Listeners are programs that wait for inbound network connection requests, and then start the appropriate channel to handle the communication
    • All queue managers need at least one listener running if they are going to recive messages or client connections.
    • standard configuration is to have a TCP/IP listener waiting for connections on port 1414.
    • if multiple queue managers are running on the same system, they require individual listeners to be configured on different ports