Consultor Eletrônico



Kbase P125943: Adapter for SonicMQ, Client Persistence: Rejected Message Consumer example
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   19/03/2009
Status: Verified

GOAL:

How to use the Rejected Message Consumer with Client Persistence

GOAL:

Rejected Message Consumer Example

GOAL:

Sample code to test ClientConnect with 4GL client

GOAL:

Sample code to test Client Persistence to connect to Sonic

GOAL:

Sample code to test 4GL connecting to Sonic MQ broker

FACT(s) (Environment):

Sonic MQ 6.1
Sonic MQ 7.x
OpenEdge 10.1x

FIX:

The following code illustrates the use of the Rejected Message Consumer. The RMC's purpose is to catch and handle messages that are rejected during a Client Persistence recovery.
1. Modify the connection information for your environment.
2. Make sure you have the queues SampleQ1 and SampleQ2 created on the broker.
3. Execute the code and follow the Alert box directions
Code logic:
1. Sends messages 1-4 and then instructs user to stop the broker so that Client Persistence can take over.
2. Sends messages 5-8 to the clients local store while the broker is offline.
3. Instructs user to restart the broker, so that the messages delivered while it was offline are recovered by the Client Persistence.
4. Sends messages 9 and 10 when the broker is back online.
5. Calls waitForMessages() and consumes the exceptions for the rejected messages 5 and 7.