Contents
This sample demonstrates the use of the TIBCO StreamBase® Adapter for 29West LBM.
This adapter requires access to the JAR file that implements the 29West LBM Java API on your system, and any files referenced by that JAR file. You will need to add your site's LBM implementation version of that file to your maven repository. The 29 west sample includes a pom.xml file with comments on how to maven install the required jar files for V6.0
mvn install:install-file -DgroupId=Informatica -DartifactId=UMS -Dversion=6.0.0 -Dpackaging=jar -Dfile=path/to/Informatica/UMQ_6.0/UM_Java_API_6_0/UMS_6.0_jdk1.5.0_12.jar mvn install:install-file -DgroupId=Informatica -DartifactId=UMSPDM -Dversion=6.0.0 -Dpackaging=jar -Dfile=path/to/Informatica/UMQ_6.0/UM_Java_API_6_0/UMSPDM_6.0_jdk1.5.0_12.jar mvn install:install-file -DgroupId=Informatica -DartifactId=UMSSDM -Dversion=6.0.0 -Dpackaging=jar -Dfile=path/to/Informatica/UMQ_6.0/UM_Java_API_6_0/UMSSDM_6.0_jdk1.5.0_12.jar
Before launching any of the sample application you will also need to setup the launch config to include the Path
which includes the location of the Informatica install location. Also a LBM_LICENSE_FILENAME
variable should be defined with the path to the license file. *** Please note that these variables are ONLY SET AT INSTALL
OF A NODE, if you are using an existing node these will not take effect.
Informatica purchased 29West and has since released an update of the LBM API, renamed Ultra Messaging Streaming Edition, or UMS. This adapter works with the UMS 6.x JAR files, but you cannot mix LBM and UMS installations. You must thoroughly uninstall any LBM 4.x kit before reinstalling a UMS 6.x kit. Since UMS is a workalike superset of LBM, this page uses "LBM" to refer to both.
If you get an error message whose text refers to can't load lbmj: java.lang.UnsatisfiedLinkError: no lbmj in java.library.path
, make sure the directory containing the LBM native libraries is on the path.
The LBM API implementation described in this section is a product of a third party, and its specifications and file names are subject to change by 29West. See your LBM documentation for the latest information.
-
In the Project Explorer, double-click
29west-lbm.sbapp
. -
Click the Run button. This opens the SB Test/Debug perspective and starts the application.
-
In the Test/Debug Perspective, open the Output Streams view. Observe a "Source Notification" tuple on the
SubscribeStatus
stream indicating the LBM publish adapter is ready to publish to the default topic,my.default.topic
. -
In the Manual Input view, click
. Two additional tuples appear in the Output Streams view from theSubscribeStatus
andMessagesReceived
streams indicating:-
The transport session for the default topic has begun.
-
An LBM message from the default topic was received.
-
-
When done, press F9 or click the Stop Running Application button.
The sample includes a pair of StreamBase applications that illustrate the use of persistence in the LBM publish and subscribe adapters. The applications are run independently, first with the source run from StreamBase Studio and the receiver from a terminal window to demonstrate source recovery, then with the receiver run from StreamBase Studio and the source from a terminal window to demonstrate receiver recovery.
-
Start the Ultra Messaging store daemon,
umestored
, using theume-example-config.xml
configuration file shipped with this sample. -
Open a terminal windows on UNIX, or a StreamBase Command Prompts on Windows. Navigate to your workspace copy of the sample, as described above, and type:
sbd -p 10001 persistence-receiver.sbapp
Note
The -p 10001 option is required to avoid a TCP port conflict, since StreamBase Studio's default server port is 10000.
-
In the Project Explorer, double-click
persistence-source.sbapp
. -
Click the Run button. This opens the SB Test/Debug perspective and starts the application.
-
In the Test/Debug Perspective, open the Output Streams view. Observe a tuple on the
SequenceNumberOut
stream with a sequence number of 0, indicating the LBM publish adapter should begin publishing at sequence number 0, which corresponds to application message number 1. -
Observe two "UME store registation" tuples on the
PublishStatus
stream indicating the source application,persistence-source.sbapp
has registered with the UME store,umestored
. -
Observe two "Receiver connected" tuples on the
PublishStatus
stream indicating two receivers (umestored and persistence-receiver.sbapp) have connected to the topic being published to. -
Observe four message-related tuples on the
PublishStatus
stream each second indicating an outgoing message was assigned a sequence number, delivered to the receiver, stabilized in the store, and reclaimed by the Ultra Messaging library. -
Press F9 or click the Stop Running Application button to simulate a source failure.
-
Click the Run button to restart the source application.
-
Observe the same set of tuples as above, but notice the sequence number returned on the
SequenceNumberOut
stream is non-zero, and the source therefore resumes publishing at the point in the message stream it was at when it was shut down. Observe the message-related tuples on thePublishStatus
stream reflect the new sequence number as well. -
When done, press F9 or click the Stop Running Application button.
-
Start the Ultra Messaging store daemon,
umestored
, using theume-example-config.xml
configuration file shipped with this sample. -
In the Project Explorer, double-click
persistence-receiver.sbapp
. -
Click the Run button. This opens the SB Test/Debug perspective and starts the application.
-
Open a terminal windows on UNIX, or a StreamBase Command Prompts on Windows. Navigate to your workspace copy of the sample, as described above, and type:
sbd -p 10001 persistence-source.sbapp
Note
The -p 10001 option is required to avoid a TCP port conflict, since StreamBase Studio's default server port is 10000.
-
In the Test/Debug Perspective, open the Output Streams view. Observe a stream of tuples on the
MessagesReceived
stream containing the messages published by the source. -
In the Manual Input view enter
false
in theSubscribe
field and clickSend Data
to simulate a receiver failure. -
Observe the stream of
MessagesReceived
tuples stop. Note the sequence number of the lastMessagesReceived
tuple. -
Click
Clear
to clear the displayed tuples in the Applicaton Output view. -
In the Manual Input view enter
true
in theSubscribe
field and clickSend Data
. -
Observe a burst of
MessagesReceived
tuples that were published during the receiver failure. Observe the sequence number of the firstMessagesReceived
tuple in the burst is one more than that of the last received message before the failure. -
In the Manual Input view enter
false
in theSubscribe
field and clickSend Data
to simulate another receiver failure. -
In the Manual Input view enter
true
in theSubscribe
field and zero in theRecoverySequenceNumber
field and clickSend Data
. -
Observe that the receiver now recovers the from the beginning of the message stream instead of from where it left off before the latest failure.
Note
Depending on the configuration of the UME store and the publish rate, the receiver may not be able to recover the enire message stream.
-
When done, press F9 or click the Stop Running Application button.
In StreamBase Studio, import this sample with the following steps:
-
From the top menu, click
→ . -
Select this sample from the Embedded Input Adapters list.
-
Click OK.
StreamBase Studio creates a single project containing the sample files.
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_29west-lbm
See Default Installation Directories for the 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/29west-lbm
See Default Installation Directories for the default location of studio-workspace
on your system.