Multiple Instances and Sessions

You can attach the Sybase CEP Reuters Consumer adapter to multiple streams across multiple projects, resulting in multiple instances of the adapter running concurrently.

When you specify the property values for the adapter, use a different subscriber stream for each instance. You can use the same or different configuration files for multiple instances. Using different RFA configuration files allows you to have adapter instances connecting to different sessions and therefore different providers. If you use the same application configuration file for two or more instances of the adapter, the only difference between the instances is the subscriber stream. Each instance uses the same property values as specified in the application configuration file, including the same symbol file and the same session.

If you use different application configuration files for multiple adapter instances, you may choose to specify different values for the properties defined in that file, including provider information, dictionary settings, session identification, and the symbol file. Define the session you specify in the application configuration file as a node in the specified RFA configuration file (\Sessions\session_name\connectionList).

If you want to use multiple sessions (for example, to access providers on different ports) define connection information for each session, either in multiple RFA configuration files, or in a single RFA configuration file:
\Connections\Connection_OMM\connectionType = "RSSL" 
\Connections\Connection_OMM\rsslPort = "8101" 
\Connections\Connection_OMM\hostName = "localhost"
\Connections\Connection_OMM2\connectionType = "RSSL" 
\Connections\Connection_OMM2\rsslPort = "14009" 
\Connections\Connection_OMM2\hostName = "localhost" 
This example shows connection information for two sessions. Later in the same file, define the two sessions and specify the association with the connection information:
\Sessions\SessionOMM\connectionList     = "Connection_OMM"
\Sessions\SessionOMM2\connectionList    = "Connection_OMM2"

Two sessions using the same connection information results in unpredictable behavior, so verify that each session uses different connection information.

In your application configuration file, you identify the session, and therefore the connection settings, that every adapter instance reading that file uses:
\session                = "SessionOMM2"

When Sybase CEP Server starts an instance of the Sybase CEP Reuters Consumer adapter, it reads the application configuration file to determine the name of the session to use. If a session with the same name is already running, the adapter uses that session. Otherwise, it creates a new session using the connection parameters specified in the RFA configuration file.