Home | Previous Page | Next Page   MQ DataBlade Module > MQ DataBlade Functions > MQPublish() > 3 3 3

Examples

3

Example 1: 3

3
begin;
3EXECUTE FUNCTION MQPublish('Testing 123');
3commit:
3

This example publishes the message with the following parameters: 3

3 3

Example 2: 3

3
begin;
3EXECUTE FUNCTION MQPublish('MYPUBLISHER','Testing 345','TESTTOPIC');
3commit;
3

This example publishes the message with the following parameters: 3

3 3

Example 3: 3

3
begin;
3EXECUTE FUNCTION MQPublish('MYPUBLISHER','MYPOLICY','Testing 678','TESTTOPIC',
3'TEST1');
3commit;
3

This example publishes the message with the following parameters: 3

3 3

Example 4: 3

3
begin;
3EXECUTE FUNCTION MQPublish('Testing 901','TESTS');
3commit;
3

This example publishes the message with the following parameters: 3

3 3

Example 5: 3

3
begin;
3EXECUTE FUNCTION MQPublish('SEND.MESSAGE', 'emergency', 'CODE BLUE', 'expedite');
3commit;
3

This example publishes the message with the following parameters: 3

3 3

Example 6: The following table contains sample rows and columns 3in the "informix".mqipubsub table. 3

3 333333333333333333333333
pubsubname column receiver column pubsubtype column
Sample row 1 3
'IDS.DEFAULT.
3PUBLISHER'
3
' ' 'Publisher'
Sample row 2 3
'IDS.DEFAULT.
3SUBSCRIBER'
3
3
'IDS.DEFAULT.
3SUBSCRIBER.RECEIVER'
3
'Subscriber'

3

3
begin;
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

3 3

3
begin;
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

3 3

3
begin;
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 Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]