Subscribing for an Out-of-Process Adapter

A description of the functionality required to implement guaranteed processing for an out-of-process adapter and the corresponding Sybase CEP C/C++ in-process API functions you use for each.

Action

Function

Establish a session

C8SubscriberCreateGD

Receive and process batches of messages

C8SubscriberGetNextBatch

Re-establish a session after a failure

C8SubscriberCreateGD (only required after an adapter restart)

Specify the ID of the last batch processed

Passed as an argument to C8SubscriberCreateGD

If you are converting an existing out-of-process adapter to Guaranteed Delivery, you may find it easier to use these functions for subscribing to messages instead:

Create and publish batches of messages

C8SubscriberGetNextMessage with C8SubscriberGetLastBatchId

If you use these functions, you must keep track of the batch ID so that you can save it to persistent storage at the appropriate time. The function C8SubscriberGetLastBatchId returns the ID of the last complete batch of messages that you have processed with C8SubscriberGetNextMessage. As soon as the ID changes, you should save it to persistent storage so that you can correctly identify the last batch processed after a failure.

See C/C++ API Interface adaptersAPI Interface for specific syntax and usage information.

Sybase CEP provides an example output adapter that implements Guaranteed Delivery, called example_gd_output_adapter.c. You can find it under your Sybase CEP Server or Sybase CEP Studio installation directory, in the sdk/c/examples directory.