Writing a WebSphere MQ application

Introducing the Message Queue Interface
What is in the MQI?
Calls
Syncpoint calls
WebSphere MQ for z/OS calls
i5/OS calls
WebSphere MQ calls on other platforms
Data conversion
Structures
Elementary data types
WebSphere MQ data definitions
WebSphere MQ stub programs and library files
WebSphere MQ for z/OS
WebSphere MQ for iSeries
WebSphere MQ for Windows
WebSphere MQ for AIX
WebSphere MQ for HP-UX
WebSphere MQ for Linux
WebSphere MQ for Solaris
Parameters common to all the calls
Using connection and object handles
Understanding return codes
Specifying buffers
Programming language considerations
Coding in C
Parameters of the MQI calls
Parameters with undefined data type
Data types
Manipulating binary strings
Manipulating character strings
Initial values for structures
Initial values for dynamic structures
Use from C++
Coding in COBOL
Named constants
Coding in System/390(R) assembler language
Names
Using the MQI calls
Declaring constants
Specifying the name of a structure
Specifying the form of a structure
Controlling the listing
Specifying initial values for fields
Writing reenterable programs
Using CEDF
Coding in RPG
Coding in PL/I
Structures
Named constants
Coding in Visual Basic
z/OS batch considerations
UNIX signal handling
Unthreaded applications
Threaded applications
Synchronous signals
Asynchronous signals
Additional considerations for threaded client applications
Additional considerations
Fastpath (trusted) applications
MQI function calls within signal handlers
Signals during MQI calls
User exits and installable services
Connecting to and disconnecting from a queue manager
Connecting to a queue manager using the MQCONN call
Scope of MQCONN or MQCONNX
Connecting to a queue manager using the MQCONNX call
Restrictions for trusted applications
Shared (thread independent) connections with MQCONNX
Shared connection usage notes
MQCONNX environment variable
Disconnecting programs from a queue manager using MQDISC
When no MQDISC is issued
Authority checking
Opening and closing objects
Opening objects using the MQOPEN call
Scope of an object handle
Identifying objects (the MQOD structure)
Name resolution
Using the options of the MQOPEN call
MQOPEN option for cluster queue
MQOPEN option for putting messages
MQOPEN option for browsing messages
MQOPEN options for removing messages
MQOPEN options for setting and inquiring about attributes
MQOPEN options relating to message context
MQOPEN option for alternate user authority
MQOPEN option for queue manager quiescing
MQOPEN option for resolving local queue names
Creating dynamic queues
Opening remote queues
Closing objects using the MQCLOSE call
Putting messages on a queue
Putting messages on a local queue using the MQPUT call
Specifying handles
Defining messages using the MQMD structure
Specifying options using the MQPMO structure
The data in your message
Putting messages on a remote queue
Controlling context information
Passing identity context
Passing all context
Setting identity context
Setting all context
Putting one message on a queue using the MQPUT1 call
Distribution lists
Opening distribution lists
Using the MQOD structure
Using the MQOR structure
Using the MQRR structure
Using the MQOPEN options
Putting messages to a distribution list
Using the MQPMR structure
Using MQPUT1
Some cases where the put calls fail
Getting messages from a queue
Getting messages from a queue using the MQGET call
Specifying connection handles
Describing messages using the MQMD structure and the MQGET call
Specifying MQGET options using the MQGMO structure
Specifying the size of the buffer area
The order in which messages are retrieved from a queue
Priority
Logical and physical ordering
Grouping logical messages
Putting and getting a group that spans units of work
Getting a particular message
Type of index
Handling messages greater than 4 MB long
Increasing the maximum message length
Message segmentation
Segmentation and reassembly by queue manager
Application segmentation
Application segmentation of logical messages
Putting and getting a segmented message that spans units of work
Reference messages
Using the MQRMH and MQMD structures
Waiting for messages
Signaling
To set a signal
When the message arrives
Skipping backout
Application data conversion
Conversion of EBCDIC newline characters
Browsing messages on a queue
The browse cursor
Queues in FIFO (first in, first out) sequence
Queues in priority sequence
Uncommitted messages
Change to queue sequence
Using the queue's index
Browsing messages when the message length is unknown
Removing a message that you have browsed
Browsing messages in logical order
Browsing messages in groups
Browsing and retrieving destructively
Some cases where the MQGET call fails
Writing data-conversion exits
Invoking the data-conversion exit
Data conversion on z/OS
Writing a data-conversion exit program
Skeleton source file
Convert characters call
Utility for creating conversion-exit code
Invoking the CSQUCVX utility on z/OS
z/OS data definition statements
Error messages in Windows systems, and UNIX(R) systems
Valid syntax
Example of valid syntax for the input data set
Writing a data-conversion exit program for WebSphere MQ for iSeries
Writing a data-conversion exit program for WebSphere MQ for z/OS
Writing a data-conversion exit for WebSphere MQ on UNIX systems
UNIX environment
Non-threaded environment
Threaded environment
Compiling data-conversion exits on UNIX and Linux
On AIX(R)
On HP-UX
On Linux
On Solaris
Writing a data-conversion exit for WebSphere MQ for Windows
Inquiring about and setting object attributes
Inquiring about the attributes of an object
Some cases where the MQINQ call fails
Setting queue attributes
Committing and backing out units of work
Syncpoint considerations in WebSphere MQ applications
Syncpoints in WebSphere MQ for z/OS applications
Syncpoints in CICS Transaction Server for OS/390 and CICS for MVS/ESA(TM) applications
Syncpoints in IMS applications
Syncpoints in z/OS batch applications
Committing changes using the MQCMIT call
Backing out changes using the MQBACK call
Transaction management and recoverable resource manager services
Syncpoints in CICS for AS/400 applications
Syncpoints in WebSphere MQ for Windows, WebSphere MQ for iSeries, and WebSphere MQ on UNIX systems
Local units of work
Global units of work
Internal syncpoint coordination
External syncpoint coordination
Interfaces to external syncpoint managers
Interfaces to the i5/OS external syncpoint manager
General XA support
WebSphere MQ XA support and Tuxedo
Starting WebSphere MQ applications using triggers
What is triggering?
Prerequisites for triggering
Conditions for a trigger event
Controlling trigger events
Example of the use of trigger type EVERY
Example of the use of trigger type FIRST
Example of the use of trigger type DEPTH
Special case of trigger type FIRST
Designing an application that uses triggered queues
Trigger messages and units of work
Getting messages from a triggered queue
Trigger monitors
Trigger monitors on z/OS
Trigger monitors on UNIX systems, i5/OS, and Windows systems
For CICS:
WebSphere MQ for iSeries trigger monitors
Properties of trigger messages
Persistence and priority of trigger messages
Queue manager restart and trigger messages
Trigger messages and changes to object attributes
Format of trigger messages
When triggering does not work
How CKTI detects errors
How CSQQTRMN detects errors
How RUNMQTRM detects errors
Using and writing API exits
Introducing API exits
Why use API exits
How you use API exits
How to configure WebSphere MQ for API exits
How to write an API exit
What happens when an API exit runs?
Compiling API exits
On Solaris
32 bit applications
64 bit applications
On AIX
32 bit applications
64 bit applications
On HP-UX
32 bit applications
64 bit applications
On Linux(R)
32 bit applications
64 bit applications
On Windows systems
On i5/OS
Reference information
External control blocks
WebSphere MQ API exit parameter structure (MQAXP)
WebSphere MQ API exit context structure (MQAXC)
The exit chain area and exit chain area header (MQACH)
External constants
C language typedefs
The exit entry point registration call (MQXEP)
MQXEP C language invocation
MQXEP C function prototype
Invoking exit functions
General rules for API exit routines
The API exit functions
General information on invoking exit functions
What happens when exits fail
What if the ExitResponse fields are incorrectly set
Using and writing applications on WebSphere MQ for z/OS
Environment-dependent WebSphere MQ for z/OS functions
Program debugging facilities
Syncpoint support
Recovery support
The WebSphere MQ for z/OS interface with the application environment
The batch adapter
RRS batch adapter
Migration
The CICS adapter
CICS adapter performance considerations
Adapter trace points
Abends
Using the CICS Execution Diagnostic Facility
The IMS adapter
Writing z/OS(R) UNIX System Services applications
The API-crossing exit for z/OS
Using the API-crossing exit
Defining the exit program
How the exit is invoked
Communicating with the exit program
Writing your own exit program
Usage notes
The sample API-crossing exit program, CSQCAPX
Design of the sample exit program
Preparing and using the API-crossing exit
WebSphere MQ Workflow
Application programming with shared queues
Serializing your applications
Applications that are not suitable for use with shared queues
Deciding whether to share non-application queues
Migrating your existing applications to use shared queues
Using and writing WebSphere(R) MQ-CICS bridge applications for z/OS
Distributed program link applications
Using CICS DPL programs with the bridge
CICS DPL bridge message structure
Application programming for the CICS DPL bridge
Programming CICS DPL transactions in the distributed environment
Setting fields in the MQMD and MQCIH structures (DPL)
Setting the MQMD fields
Setting the MQCIH fields
Managing MsgId and CorrelId in a unit of work (DPL)
3270 applications
Using CICS transactions with the bridge
Using CICS bridge vectors
CICS 3270 bridge message structure
Application programming for the CICS 3270 bridge
Writing applications using CICS Basic Mapping Support
Transactions with start data
Transactions with EXEC CICS syncpoint
Programming CICS transactions in the distributed environment
From 3270 legacy to 3270 bridge - an example
Exact emulation - no optimization
Improved emulation, with optimization
Setting fields in the MQMD and MQCIH structures (3270)
Setting the MQMD fields
Setting the MQCIH fields
Managing MsgId and CorrelId in a unit of work (3270)
Information applicable to both DPL and 3270
Setting the open options and put message options for the bridge request queue
Error handling by the CICS bridge
Debugging CICS bridge applications
Application data structure terminology
IMS and IMS Bridge applications on WebSphere MQ for z/OS
Writing IMS applications using WebSphere MQ
Syncpoints in IMS applications
MQI calls in IMS applications
Server applications
Enquiry applications
Writing WebSphere MQ-IMS bridge applications
How the WebSphere MQ-IMS bridge deals with messages
Mapping WebSphere MQ messages to IMS transaction types
If the message cannot be put to the IMS queue
IMS bridge feedback codes
The MQMD fields in messages from the IMS bridge
The MQIIH fields in messages from the IMS bridge
Reply messages from IMS
Using alternate response PCBs in IMS transactions
Sending unsolicited messages from IMS
Message segmentation
Data conversion
Writing your program
Writing WebSphere MQ applications to invoke IMS conversational transactions
Triggering
Writing programs containing IMS commands
Object-oriented programming with WebSphere MQ
What is in the WebSphere MQ Object Model?
Classes
Object references
Return codes
Programming language considerations
Coding in C++
Coding in Java
Coding in ActiveX