FAST feed handler API interface

Description

The following C API defines the function signatures that you must implement to build a message handler.

Methods




initializeRAPHandler

Description

Create and initialize the Sybase RAP message handler. This method is invoked from the FAST Feed Handler code by dynamically looking up this function pointer in the message handler shared library.

Syntax

extern “C” int32_t initializeRAPHandler
( ffh_mh_info    * info,
ffh_init_param * initParams,
int32_t          initParamLen );

Parameters

ffh_mh_info * info

the info structure for calls to the message handler

ffh_init_param * initParams

the initialization parameters for the handler

int32_t initParamLen

the number of elements in the initParams array

Returns

int32_t 0 if the initialization succeeded, non 0 error code otherwise.

Usage

  1. Create a new instance of the RAP message handler, and assign it to the user_data field of the ffh_mh_info.

  2. Invoke the initialize method on the RAP message handler and return the result.




finalizeRAPCallback

Description

Invoke the Message Handler finalize method and clean up any remaining resources. This method is invoked from the FAST Feed Handler code by dynamically looking up this function pointer in the message handler shared library.

Syntax

extern “C” void finalizeRAPHandler
( ffh_mh_info * info );

Parameters

ffh_mh_info * info

the info structure for calls to the message handler

Usage

  1. Cast the user_data field of the ffh_mh_info to a RAP message handler object.

  2. Invoke the finalize method on the message handler object.

  3. Delete the handler object and set the user_data pointer in the ffh_mh_info to null.




processRAPCallback

Description

Invoke the Message Handler process method. This method is invoked from the FAST Feed Handler code by dynamically looking up this function pointer in the message handler shared library.

  1. Cast the user_data field of the ffh_mh_info to a RAP message handler object.

  2. If the event type is MHET_RECEIVE_MESSAGE, invoke the receiveMessage method on the message handler object and return the result.

Syntax

extern “C” int32_t processRAPCallback ( ffh_mh_event * event );

Parameters

ffh_mh_event * event

the event to be processed

Returns

int32_t error_code




initialize

Description

Initialize the Message Handler with any necessary setup actions. In particular, initialize the publisher API. The following table gives the initialization parameters required to be in the message handler definition in the FAST Feed Handler main configuration file.

Name Value

Description

PublisherConfigFile

This should point at the configuration file for the publisher.

Syntax

int32_t initialize( 
	ffh_mh_info * info
	ffh_init_param * initParams,
	int32_t initParamLen
);

Parameters

PublisherConfigFile

This should point at the configuration file for the publisher.

ffh_mh_info * info

the info structure for calls to the message handler

ffh_init_param * initParams

the initialization parameters for the handler

int32_t initParamLen

he number of elements in the initParams array

Returns

int32_t 0 if initialization succeeded, error code != 0 otherwise.

Usage

  1. Initialize the RAP Publisher API, passing a reference to the static publisherShutdown method and pass in the loggerID pointer. If an error occurs, log it and return false.

  2. Create a new RAP publisher send message context.

  3. Store the ffh_mh_info in the provided pointer.

  4. Return 0.




receiveMessage

Description

Process a decoded FAST message by mapping it into the publisher API.

Syntax


Parameters

ffh_mh_info * info

the info structure for this message handler

ffh_fast_meesage * fastMsg

the decoded FAST message

Returns

int32_t 0 if processing succeeded; error code != 0 otherwise

Usage

This method will contain hard-coded entries for processing specific FIX messages. The general semantics are as follows:

  1. Walk the FIX message.

  2. Once the entire FIX message has been processed (or if the message was not processed, or if an error has occurred), invoke the releaseMessage callback from the handler info structure.




finalize

Description

Clean up any resources allocated in the initialize method.

Syntax

void finalize();

Usage

  1. Call the publisher API shutdown method.

  2. Free the send message context.

  3. Clean up any remaining data structures.




publisherShutdown

Description

This is the callback method required by the Publisher API in order to indicate that a shutdown has been requested.

Syntax

static void publisherShutdown();

Usage

If the ffh_mh_info structure is not null, invoke the structure session shutdown function, passing in the ffh_mh_info.