Wombat MAMA Input Adapter Sample

This sample demonstrates the use of the StreamBase Wombat MAMA Input adapter. See Wombat MAMA Input Adapter for details on the structure and use of this adapter.

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top menu, click FileLoad StreamBase Sample.

  • Select this sample from the Embedded Input Adapters list.

  • Click OK.

StreamBase Studio creates a project for this sample.

Sample Location

By default, the sample files are installed in:

On Windows

C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\adapter\embedded\wombat-mama-sub\

On UNIX

/opt/streambase/sample/adapter/embedded/wombat-mama-sub/

When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace. StreamBase Systems recommends that you use the workspace copy of the sample, especially on UNIX, where you may not have write access to /opt/streambase. In the default installation, the path to this sample in your Studio workspace is:

UNIX:       
  ~/streambase-studio-n.m-workspace/
      sample_adapter_embedded_wombat-mama-sub
Windows XP:
  C:\Documents and Settings\username\My Documents\
      StreamBase Studio n.m Workspace\sample_adapter_embedded_wombat-mama-sub
Windows Vista or 7:
  C:\Users\username\Documents\StreamBase Studio n.m Workspace\
      sample_adapter_embedded_wombat-mama-sub

Running This Sample in StreamBase Studio

  1. To get this sample to typecheck you must specify the location of the MAMA SDK JAR file, which is typically named mamajni.jar. Follow these steps:

    1. In the Package Explorer, right click this sample's top-level project folder and select Properties from the context menu.

    2. Select Java Build Path in the contents column.

    3. Select the Libraries tab.

    4. Click Add External JARs.

    5. Navigate to the location of and select the mamajni.jar file on your local file system.

    6. Click OK.

    7. Refresh the project's typecheck environment by pressing Ctrl+F5 or by selecting the project folder in the Package Explorer, right clicking, and selecting StreamBaseRefresh Project Typecheck Environment from the context menu.

    The MAMA API loads the transport configuration from a file named mama.properties, which should reside in a directory set in the WOMBAT_PATH environment variable. An example mama.properties file is available in sample_config/mama.properties. The subscribing adapter's Middleware and Transport properties must match the properties set in mama.properties.

    It is strongly recommended that prior to running the StreamBase application, the user has a running mamalistenc client. The configuration and environment properties set in the adapter must match the parameters for the mamalistenc client.

    The sample application is named MamaSub.sbapp. It demonstrates receiving data from a Wombat Feed Handler and emitting the resulting tuples on an output stream.

  2. Double-click to open the sample application, MamaSub.sbapp.

  3. Double-click on MamaOutput adapter. In the Properties view, select the Adapter Properties tab. Set the middleware and transport options to match the values defined in your mama.properties file on WOMBAT_PATH.

  4. In adapter properties the source should be set to the MAMA Source on which you will receive data.

  5. Click the Run button. This opens the Test/Debug perspective and starts the application.

  6. In the Test/Debug Perspective, open the Manual Input view. Enter any symbol you wish to subscribe to.

  7. Open the Application Output view and observe tuples coming out of MarketDataOut stream.

  8. When done, press F9 or click the Stop Running Application button.