Kbase P46326: How to setup a connect time failover for SonicMQ Adapter cli
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/02/2004 |
|
Status: Unverified
GOAL:
How to setup a connect time failover for SonicMQ Adapter?
GOAL:
How can a client attempt a certain number of connections and send an alert if the SonicMQ Broker is unavailable?
FIX:
Example Code Snippet:
RUN jms/pubsubsession.p PERSISTENT SET pubsubsession ("-H localhost -S 5162"). RUN setBrokerURL IN pubsubsession ("localhost:2506").
RUN setNoErrorDisplay IN pubsubsession("yes").
i = 0.
DO WHILE i < 3:
RUN beginsession IN pubsubsession NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
i = i + 1.
MESSAGE "This is " + STRING(i) + " times trying to connect"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
ELSE
MESSAGE "connected"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
/* Send an alert */
IF i = 3 THEN DO:
MESSAGE " Sorry too many tries"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
RUN deletesession IN pubsubsession.
QUIT.
END.
END