Cancel method: IntBroker class
Syntax
Cancel(TransactionId, QueueName, DataType, SegmentIndex | TransactionIdArray, QueueNameArray, DataTypeArray, SegmentIndexArray)
Description
Use the Cancel method to programmatically cancel either a message, or a list of messages, from the message queue, much the same as you can do in the message monitor.
This method is only available when the message has one of the following statuses:
-
Edited
-
Error
-
New
-
Retry
-
Timeout
If you are specifying an array of messages to be canceled, and any message in the array fails for any reason (for example, you specify a message that doesn't have the correct status) no messages are canceled and the method return value is false.
Parameters
| Parameter | Description |
|---|---|
|
TransactionId | TransactionIdArray |
Specify either a single transaction ID as a string, or specify an array of string containing the transaction Ids of the messages you want to cancel. |
|
QueueName | QueueNameArray |
Specify either a single queue name as a string, or specify an array of string containing the queue names that contain the messages you want to cancel. |
|
DataType | DataTypeArray |
Specify either a single data type, or an array of integer containing the data types. See below for valid data types. |
|
SegmentIndex | SegmentIndexArray |
Specify either a specific segment, or an array of integer containing the segment numbers you want to cancel. |
For the DataType or DataTypeArray parameters, the valid data types are:
| Constant Value | Description |
|---|---|
|
%IntBroker_BRK |
Cancel the message for the web services gateway. |
|
%IntBroker_PUB |
Cancel the message for the publication contract. |
|
%IntBroker_SUB |
Cancel the message for the subscription contract. |
Returns
A Boolean value: true if the message or messages are canceled successfully, false otherwise.
Related Topics