Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » QAnywhere » Writing QAnywhere Client Applications

Implementing transactional messaging for Java clients Next Page

Cancelling QAnywhere messages


Cancelling a QAnywhere message puts the message into a cancelled state before it is transmitted. With the default delete rules of the QAnywhere Agent, cancelled messages are eventually deleted from the message store. Cancelling a QAnywhere message fails if the message is already in a final state, or if it has been transmitted to the central messaging server.

The following procedures describe how to cancel QAnywhere messages.

Note

You cannot cancel a message using the QAnywhere SQL API.

To cancel a message (.NET)
  1. Get the ID of the message to cancel.

    // msg is a QAMessage instance that has not been 
    // transmitted.
    string msgID = msg.getMessageID();
  2. Call CancelMessage with the ID of the message to cancel.

    mgr.CancelMessage(msgID);

    See CancelMessage method.

  3. To cancel a message (C++)
    1. Get the ID of the message to cancel.

      // msg is a QAMessage instance that has not been 
      // transmitted.
      qa_string msgID = msg->getMessageID();
    2. Call cancelMessage with the ID of the message to cancel.

      bool result = mgr->cancelMessage(msgID);

      See cancelMessage function.

    3. To cancel a message (Java)
      1. Get the ID of the message to cancel.

        // msg is a QAMessage instance that has not been 
        // transmitted.
        String msgID = msg.getMessageID();
      2. Call cancelMessage with the ID of the message to cancel.

        boolean result = mgr.cancelMessage(msgID);

        See cancelMessage method.