C samples
Messages must be in the following format to be read from a queue:
UPDATE Balance change=nnn WHERE Account=nnnAMQSPUT can be used to put the messages on the queue.
The database coordination samples take two parameters:
- Queue name (required)
- Queue manager name (optional)
Assuming that you have created and configured a queue manager for the single database sample called singDBQM, with a queue called singDBQ, you increment Mr Fred Bloggs’s account by 50 as follows:
AMQSPUT singDBQ singDBQMThen key in the following message:UPDATE Balance change=50 WHERE Account=1We can put multiple messages on the queue.AMQSXAS0 singDBQ singDBQMThe updated status of Mr Fred Bloggs’s account is then printed.Assuming that you have created and configured a queue manager for the multiple-database sample called multDBQM, with a queue called multDBQ, you decrement Ms Mary Brown’s account by 75 as follows:
AMQSPUT multDBQ multDBQMThen key in the following message:UPDATE Balance change=-75 WHERE Account=3We can put multiple messages on the queue.AMQSXAG0 multDBQ multDBQMThe updated status of Ms Mary Brown’s account is then printed.
Parent topic:
Running the samples
fg17780_