ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Files and Code Samples » C/C++

This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.
 C/C++ « View previous topic :: View next topic » 
Author Message
Cressida
PostPosted: Sun Sep 02, 2007 5:39 am    Post subject: C/C++ Reply with quote

Voyager

Joined: 13 Jul 2007
Posts: 96

Watchq - The GUI interface to this queue depth monitoring tool will also allow you to delete individual messages from the queue, to ease queue administration. Alerts when queue nears maximum. C source and Win32 executable are included.

Created by: Francois van der Merwe - francoisvdm@za.ibm.com

mirrorq - Makes a copy of all messages that are sent to a queue. This is a C++ sample of one way to accomplish this using triggering. It can be used for the designated purpose or just as a sample of how to setup triggering.

Created by: Charlie Lindsey/IBM

backout - A program to illustrate moving a poison message to a backout queue. Please read IBM's licensing agreement at the top of this file.

Created by: IBM Corporation - provided by Ron Bower

xa_mqs_oracle - This example shows how to use MQSeries and Oracle in a distributed transaction. MQSeries queue manager serves as a TX transaction manager and as an XA resource manager, while Oracle DBMS serves as an XA resource manager only.
The MQI API is used to access MQSeries, and OCI API is used to access Oracle.
The program arguments are:
#1 Name of the queue manager (the TX transaction manager)
#2 Name of the queue from which a message is received
#3 Name of the table to which the message is inserted
#4 Name of the actual column to which the message is inserted
The program receives a message from the specified queue, and inserts it into the specified database table - all within the same distributed transaction

Created by: Predrag Maksimovic (Max) - pmaksimovic@2d3d.com

PUBSUB - Function : This programs starts the broker on child queue manager and on parent queue manager. The QueueManager names are passed as arguments to this program.
Before running this program the following are the requirements:
a) QueueManagers in the relationship are started
b) Brokers in a relationship reuire their queue mangers to commuicate both ways between each other, hence create channels for communication.
c) Ensure that listener for each queue manager has been started
d) create a separate Batch File to start the QueuManagers and Listeners.
This program was tested with MSVC++ 6.0 compiler
NOTE 1 : If you have problem starting the child broker,its recommended that you allow a delay of a few seconds between starting related brokers for the first time as this allows the parent broker to be running before the child registers with it.

Created by: IBM

putgroup - This program is a modified version of the AMQSPUT0.C program. It has been changed to put messages as part of a group. This is done by looking for the enter key being used at the end of each group. In addition, a second enter key is needed to end the program. The program will generate an extra message with the enter key that ends the group that will be used to mark the end of the group.

Created by: IBM

srvpcf.cpp - The following is a small sample PCF program, provided by Ron Bower, IBM SDMTSC, that can be used to change the batchsize parameter on a channel. It is run by typing:
srvpcf /c /b /m
or
srvpcf -c -b -m
The parameters are as follows:
/c: the channel name to change
/b: the new batchsize
/m: the queue manager that has the channel
The program does minimal error checking. It is strictly designed as a sample program to show how PCF commands are built and sent to the command server.

Created by: IBM

getgroup - This program is a modified version of the AMQSGET0.C program. It has been changed to check for messages being part of a group. If they are, the program will get all messages in a group before getting any more messages.

Created by: IBM

ntloadmq - This program is a based on the AMQSGET0.C and AMQSPUT0.C programs that come with the MQSeries for NT product. They has been modified to use the LoadLibrary and GetProcAddress APIs to load the MQSeries library and its entry points. In addition, it shows the use of the _putenv API to change the environment that the program runs under. This program has been tested with the MSVC++ 4.2 compiler:
cl -MT -Z7 -Od -c -W1 -D_X86=1 -DWIN32 ntloadmq.c
link -OUT:ntloadmq.exe ntloadmq.obj

Created by: IBM

sunloadmq - This program is a modified version of the AMQSGET0.C program that comes with the MQSeries product. It has been changed to use the dlopen and dlsym calls to dynamically load the MQSeries libraries and its entry points. This program is built with the following command line:
cc -o sunloadmq sunloadmq.c -mt -ldl

Created by: IBM

slloadmq - This program is a modified version of the AMQSGET0.C program that comes with the MQSeries for AIX product. It has been changed to use the dlopen and dlsym calls to dynamically load the MQSeries library and its entry points. This program is built with the following command line:
cc -o slloadmq slloadmq.c -ldl
The dlopen call is a call that exists in AIX 4.2 or greater.

Created by: IBM

mqsync.cpp - This program is a modified version of the mqsync.c program. It is written in C++ and shows the use of the C++ objects and methods to put messages in syncpoint by checking the message buffer for the following text:
SYNC or sync: the message is to be put in syncpoint
CMIT or cmit: the syncpointed messages are to be committed
BACK or back: the syncpointed messages are to be backed out

Created by: IBM

corrid.cpp - This program shows the use of the ImqMessageTracker object to set the correlation id for both the use of puts and gets of messages to a queue. It has three correlation ids that it uses to put and get the messages. The specific id is selected by putting a 1, 2, or 3 in the text of the message on the puts. The user is then asked which correlation id to use on the gets. This program has been tested with the MSVC++ 4.2 compiler:
cl -MT corrid.cpp imqb23vn.lib imqs23vn.lib
Note: Use imqc23vn.lib instead of imqs23vn.lib for a client connect.

Created by: IBM

mqsrv.cpp - Sample C++ program that shows the use of the message id and correlation id in passing messages between a request and reply message. This program should be used in conjunction with the mqreq sample program. The best way to use the mqreq and mqsrv samples is to start them in separate MS-DOS Prompt windows. They need to run against the same queue and queue manager. As data is entered in the mqreq window, the mqsrv program will get it and reply back to mqreq. When a blank line is entered in the mqreq window, the program will end. The mqsrv program has a 15 second timeout on the message gets.

Created by: IBM

xa_mqs_db2 - This examples shows how to use MQSeries and DB2 in a distributed transaction. MQSeries queue manager serves as a TX transaction manager and as an XA resource manager, while DB2 DBMS serves as an XA resource manager only. MQI API is used to access MQSeries, and CLI API is used to access DB2. The program arguments are:
#1 The name of the queue manager (the TX transaction manager)
#2 The name of the queue from which a message is received
#3 The name of the DB2 data source
#4 The name of the table to which the message is inserted
#5 The name of the actual column to which the message is inserted
The program receives a message from the specified queue, and inserts it into the specified database table - all within the same distributed transaction.

Created by: Predrag Maksimovic (Max) - pmaksimovic@2d3d.com

cryptexit - This C program is based on the IBM redbook id SG24-5306. This provides the functionality for connecting channels to authentic with each other and pass messages between queue managers in encrypted form using RSA. A precompiled DLL for NT is included, but this code can be easily ported to UNIX and mainframe as described in the redbook. People installing this package should have a very detailed understanding of channel intercommunication and security/channel exit routines. Thanks to Tibor for contributing this code!

Created by: Tibor

DeadLetterHandler - This C source code is similar to other dead letter queue handles that you may have seen, but this one has a nice additional function. Not only will it browse the dead letter queue and place the dead letter headers of any messages on that queue in an easy to read report, but it will also reprocess these messages if you give it the necessary switch. In other words, it will attempt to reroute the messages on the dead letter queue to the original queues they were destined for, along with all the correct header information like MsgId and CorrelId. This is very useful if messages end up on the dead letter queue because of temporary conditions (like the queue being full).

Created by: Brandon Duncan
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies. Page 1 of 1

MQSeries.net Forum Index » Files and Code Samples » C/C++
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.