Contents
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.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, click
> . -
Enter
ftl
to narrow the list of options. -
Select TIBCO FTL input/output adapters from the Other TIBCO Product Connectivity category.
-
Click
.
StreamBase Studio creates a project for this sample.
You must edit the project's src/main/configurations/engine.conf
file to edit the externalNativeLibraryPath
and externalClassPath
entries to reflect your FTL installation's path.
You must also verify that the system PATH variable includes the FTL bin
directory, and it must be the first element in the PATH when
this node is installed. This is to prevent possible errors such as the following:
Error is java.lang.UnsatisfiedLinkError: C:\TIBCO\ftl\6.1\bin\tibftljni.dll: Can't find dependent libraries
The sample also requires a FTL maven artifact be installed, the sample comes with a
launch config which will install the tibftl.jar
and
tibftlgroup.jar
into your local maven repository with
the correct group and artifact name. To use this please place your installed copy of
tibftl.jar
and tibftlgroup.jar
into the root of the sample workspace and run
ftl-6.0 maven install.launch
and ftlgroup-6.0 maven install.launch
-
Start the TIBCO FTL realm server. The sample assumes it is running on localhost, port 8080.
-
In the Project Explorer view, open the sample you just loaded.
If you see red marks on a project folder, wait a moment for the project to load its features.
If the red marks do not resolve themselves after a minute, select the project, right-click, and select
> from the context menu. -
Open the
src/main/eventflow/
folder.packageName
-
Select the Subscribe adapter icon to open the Properties view for the adapter.
-
Adjust the Realm Server URL, Application Name, and Endpoint Name properties to match the realm server configuration.
-
Repeat the previous step for the Publisher adapter.
-
Open the
tibco-ftl.sbapp
file and click the Run button. This opens the SB Test/Debug perspective and starts the module. -
In the Test/Debug Perspective, open the Output Streams view. If the adapter is able to connect to the realm server, two
Connected
status tuples appear, one from each TIBCO FTL adapter instance. -
In the Manual Input view, select the
PublishIn
stream and click . Additional tuples appear in the Output Streams view from theSubscribeOut
andSubscribeStatus
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).
-
-
When done, press F9 or click the Terminate EventFlow Fragment button.
You must edit the project's src/main/configurations/engine.conf
file to edit the externalNativeLibraryPath
and externalClassPath
entries to reflect your FTL installation's path.
You must also verify that the system PATH variable includes the FTL bin
directory, and it must be the first element in the PATH when
this node is installed. This is to prevent possible errors such as the following:
Error is java.lang.UnsatisfiedLinkError: C:\TIBCO\ftl\6.1\bin\tibftljni.dll: Can't find dependent libraries
The sample also requires a FTL maven artifact be installed, the sample comes with a
launch config which will install tibftl.jar
and
tibftlgroup.jar
into your local maven repository with
the correct group and artifact name. To use this please place your installed copy of
tibftl.jar
and tibftlgroup.jar
into the root of the sample workspace and run
ftl-6.0 maven install.launch
and ftlgroup-6.0 maven install.launch
-
Start the TIBCO FTL realm server. The sample assumes it is running on localhost, port 8080.
-
In the Project Explorer view, open the sample you just loaded.
If you see red marks on a project folder, wait a moment for the project to load its features.
If the red marks do not resolve themselves after a minute, select the project, right-click, and select
> from the context menu. -
Open the
src/main/eventflow/
folder.packageName
-
Select the Map Get adapter icon to open the Properties view for the adapter.
-
Adjust the Realm Server URL, Application Name, and Endpoint Name properties to match the realm server configuration.
-
Repeat the previous step for the Map Set, Map Iterate and Map Remove adapters.
-
Open the
tibco-ftl-maps.sbapp
file and click the Run button. This opens the SB Test/Debug perspective and starts the module. -
In the Test/Debug Perspective, open the Output Streams 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. -
In the Manual Input view, select the
MapSetIn
stream and click . An additional tuple appears in the Output Streams view from theMapSetStatus
stream indicating the message was successfully set in the map. -
In the Manual Input view, select the
MapGetCommands
stream and set the following values:-
Command:
Get
-
FTLMapName:
tibmap
-
FTLKeyName:
Key1
Click
. A tuple appears in the Output Streams view from theMapGetResult
stream describing the message that was successfully retrieved from the map. -
-
In the Manual Input view, select the
MapIterateCommands
stream and set the following values:-
Command:
Iterate
-
FTLMapName:
tibmap
Click
. Two tuples appear in the Output Streams view from theMapIterateResult
s 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. -
-
In the Manual Input view, select the
MapSetIn
stream and click . An additional tuple appears in the Output Streams view from theMapSetStatus
stream indicating the message was successfully set in the map. -
In the Manual Input view, select the
MapRemoveCommands
stream and set the following values:-
Command:
Remove
-
FTLMapName:
tibmap
-
FTLKeyName:
Key1
Click
. A tuple appears in the Output Streams view from theMapRemoveStatus
stream to indicate that the message was successfully removed from the map. -
-
When done, press F9 or click the Terminate EventFlow Fragment button.
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.