A guaranteed delivery (GD) system ensures that messages are processed exactly once, completely, in order, and with resiliency to failure. Sybase CEP provides GD functionality for MSMQ input and output adapters.
The GD mode MSMQ input adapter performs the following actions:
- Initializes a MSMQ transaction queue.
- Establishes a connection to Sybase CEP Engine with a unique session ID.
- Receives messages from the transaction queue; sends messages in a batch, each with a unique batch ID, and waits for acknowledgment of that batch from the subscriber.
- Uses transactions to commit or rollback queue operations:
- If Sybase CEP Engine successfully receives the batch, commits the queue operations.
- If Sybase CEP Engine does not receive the batch, performs rollback on the queue operations.
- In cases of connection failure, and CEP Engine crash and restart:
- Detects a return after the failure and re-establishes the connection to Sybase CEP Engine with the same session ID.
- If there are duplicate messages, skips and commits the messages.
The GD mode MSMQ output adapter performs the following actions:
- Initializes a MSMQ transaction queue.
- Establishes a connection to Sybase CEP Engine with a unique session ID.
- Subscribes to messages with unique batch IDs in Sybase CEP Engine, and sends messages to transaction queue.
- Uses transactions to commit or rollback queue operations:
- If queue successfully receives the batch, commits the queue operations.
- If queue does not receive the batch, performs rollback on the queue operations.
- Uses CEP persistence to store the messages with a unique batch ID.
- In cases of connection failure, and Sybase CEP Engine crash and restart:
- Detects a return after the failure and re-establishes the connection to Sybase CEP Engine with the same session ID.
- Restores messages from CEP persistence, and sends the messages to the transaction queue.
MS queues created with GD mode MSMQ adapters are transaction queues. You cannot reuse transaction queues with non-GD mode MSMQ adapters. You also can not reuse regular queues created with non-GD mode MSMQ adapters with the GD mode MSMQ adapters.
Persistence in Sybase CEP does not support all crash scenarios. In some instances of Sybase CEP Engine crash and restart, duplicate messages are sent to an outsource application. The outsource application should filter the duplicate messages.
Guaranteed processing asks to confirm each input and output message in Sybase CEP Engine. As a result, guaranteed processing-enabled adapters have lower performance speed than adapters without guaranteed delivery enabled.