Example 1: 3
3begin; 3EXECUTE FUNCTION MQPublish('Testing 123'); 3commit:3
This example publishes the message with the following parameters: 3
3Example 2: 3
3begin; 3EXECUTE FUNCTION MQPublish('MYPUBLISHER','Testing 345','TESTTOPIC'); 3commit;3
This example publishes the message with the following parameters: 3
3Example 3: 3
3begin; 3EXECUTE FUNCTION MQPublish('MYPUBLISHER','MYPOLICY','Testing 678','TESTTOPIC', 3'TEST1'); 3commit;3
This example publishes the message with the following parameters: 3
3Example 4: 3
3begin; 3EXECUTE FUNCTION MQPublish('Testing 901','TESTS'); 3commit;3
This example publishes the message with the following parameters: 3
3Example 5: 3
3begin; 3EXECUTE FUNCTION MQPublish('SEND.MESSAGE', 'emergency', 'CODE BLUE', 'expedite'); 3commit;3
This example publishes the message with the following parameters: 3
3Example 6: The following table contains sample rows and columns 3in the "informix".mqipubsub table. 3
3 3| 3 | pubsubname column | 3receiver column | 3pubsubtype column | 3
|---|---|---|---|
| Sample row 1 | 3
3 'IDS.DEFAULT. 3PUBLISHER' 3 |
3' ' | 3'Publisher' | 3
| Sample row 2 | 3
3 'IDS.DEFAULT. 3SUBSCRIBER' 3 |
3
3 'IDS.DEFAULT. 3SUBSCRIBER.RECEIVER' 3 |
3'Subscriber' | 3
3
3begin; 3 EXECUTE FUNCTION 3 MQSubscribe('IDS.DEFAULT.SUBSCRIBER', 3 'IDS.DEFAULT.PUB.SUB.POLICY', 'Weather'); 3commit;3
This statement demonstrates a subscriber registering an interest 3in messages containing the topic "Weather," with the following parameters: 3
3begin; 3 EXECUTE FUNCTION MQPublish('IDS.DEFAULT.PUBLISHER', 3 'IDS.DEFAULT.PUB.SUB.POLICY', 'Rain', 'Weather'); 3commit;3
This statement publishes the message with the following parameters: 3
3begin; 3 EXECUTE FUNCTION MQReceive('IDS.DEFAULT.SUBSCRIBER.RECEIVER', 3 'IDS.DEFAULT.PUB.SUB.POLICY'); 3commit;3
This statement receives the message with the following parameters 3(it returns "Rain"): 3
3