TIBCO FTL Adapter Sample

This sample demonstrates the use of the TIBCO StreamBase® Adapters for TIBCO FTL®, as well as the use of map-related operations using the FTL Map Adapters.

Note

Before running this sample, be sure to configure the TIBCO FTL tibftl.jar file and make the FTL middleware libraries available to the system, as described in TIBCO Middleware Dependencies in the TIBCO FTL Subscribing Input Adapter or TIBCO FTL Publishing Output Adapter pages of the Adapters Guide.

Running The Publish-Subscribe Sample in StreamBase Studio

When running this sample in StreamBase Studio, edit the project's Build Path to add a reference to your FTL installation's tibftl.jar file in the Libraries tab (for FTL versions 6.0 and above, also add a reference to tibftlgroup.jar). When running this sample outside of StreamBase Studio on Windows, first run the Setup_Env.bat script in the sample's folder before running the sample.

In either case, you must also edit the project's sbd.sbconf file to edit the <jar> and <library> entries to reflect your FTL installation's path.

  1. Start the TIBCO FTL realm server. The sample assumes it is running on localhost, port 8080.

  2. In the Package Explorer, double-click tibco-ftl.sbapp.

  3. Select the Subscribe adapter icon to open the Properties view for the adapter.

  4. Adjust the Realm Server URL, Application Name, and Endpoint Name properties to match the realm server configuration.

  5. Repeat the previous step for the Publisher adapter.

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

  7. In the Test/Debug Perspective, open the Application Output view. If the adapter is able to connect to the realm server, two Connected status tuples appear, one from each TIBCO FTL adapter instance.

  8. In the Manual Input view, select the PublishIn stream and click Send Data. Additional tuples appear in the Application Output view from the SubscribeOut and SubscribeStatus streams indicating the following:

    • The message published by the FTL output adapter was received by the FTL input adapter.

    • The received message was acknowledged (assuming the subscribe adapter's Explict ACK property remains enabled).

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

Running The FTL Map Sample in StreamBase Studio

When running this sample in StreamBase Studio, edit the project's Build Path to add a reference to your FTL installation's tibftl.jar file in the Libraries tab (for FTL versions 6.0 and above, also add a reference to tibftlgroup.jar). When running this sample outside of StreamBase Studio on Windows, first run the Setup_Env.bat script in the sample's folder before running the sample.

In either case, you must also edit the project's sbd.sbconf file to edit the <jar> and <library> entries to reflect your FTL installation's path.

  1. Start the TIBCO FTL realm server. The sample assumes it is running on localhost, port 8080.

  2. In the Package Explorer, double-click tibco-ftl-maps.sbapp.

  3. Select the Map Get adapter icon to open the Properties view for the adapter.

  4. Adjust the Realm Server URL, Application Name, and Endpoint Name properties to match the realm server configuration.

  5. Repeat the previous step for the Map Set, Map Iterate and Map Remove adapters.

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

  7. In the Test/Debug Perspective, open the Application Output view. If the adapters are able to connect to the realm server, four Connected status tuples appear, one from each TIBCO FTL Map adapter instance.

  8. In the Manual Input view, select the MapSetIn stream and click Send Data. An additional tuple appears in the Application Output view from the MapSetStatus stream indicating the message was successfully set in the map.

  9. In the Manual Input view, select the MapGetCommands stream and set the following values:

    • Command: Get

    • FTLMapName: tibmap

    • FTLKeyName: Key1

    Click Send Data. A tuple appears in the Application Output view from the MapGetResult stream describing the message that was successfully retrieved from the map.

  10. In the Manual Input view, select the MapIterateCommands stream and set the following values:

    • Command: Iterate

    • FTLMapName: tibmap

    Click Send Data. Two tuples appear in the Application Output view from the MapIterateResults stream: one describing the message that previously added to the map, and one with all fields including FTLMapName and FTLKeyName set to null to indicate the end of the list.

  11. In the Manual Input view, select the MapSetIn stream and click Send Data. An additional tuple appears in the Application Output view from the MapSetStatus stream indicating the message was successfully set in the map.

  12. In the Manual Input view, select the MapRemoveCommands stream and set the following values:

    • Command: Remove

    • FTLMapName: tibmap

    • FTLKeyName: Key1

    Click Send Data. A tuple appears in the Application Output view from the MapRemoveStatus stream to indicate that the message was successfully removed from the map.

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

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

When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.

Important

Load this sample in StreamBase Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.

Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:

studio-workspace/sample_adapter_embedded_tibco-ftl

See Default Installation Directories for the default location of studio-workspace on your system.

In the default TIBCO StreamBase installation, this sample's files are initially installed in:

streambase-install-dir/sample/adapter/embedded/tibco-ftl

See Default Installation Directories for the default location of studio-workspace on your system.