29West LBM Adapter Sample

This sample demonstrates the use of the TIBCO StreamBase® Adapter for 29West LBM.

29West LBM Middleware Dependencies

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 29West 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 modules, you also need to setup the launch configuration to include the Path that includes the location of the Informatica installation location. Also, an LBM_LICENSE_FILENAME variable should be defined with the path to the license file.

Note

These variables ONLY TAKE EFFECT AT INSTALLATION OF A NODE. If you are using an existing node, these do 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.

Importing This Sample into StreamBase Studio

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

  • From the top-level menu, click File>Import Samples and Community Content.

  • Enter 2 to narrow the list of options.

  • Select 29West LBM input/output adapters from the StreamBase Messaging Adapters category.

  • Click Import Now.

StreamBase Studio creates a single project containing the sample files.

Running This Sample in StreamBase Studio

  1. 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 Maven>Update Project from the context menu.

  2. Open the src/main/eventflow/packageName folder.

  3. Open the 29west-lbm.sbapp file and click the Run button. This opens the SB Test/Debug perspective and starts the module.

  4. 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.

  5. In the Manual Input view, click Send Data. Two additional tuples appear in the Output Streams view from the SubscribeStatus and MessagesReceived streams indicating:

    • The transport session for the default topic has begun.

    • An LBM message from the default topic was received.

  6. When done, press F9 or click the Terminate EventFlow Fragment button.

Running the Persistence Sample

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.

Source Recovery

  1. Start the Ultra Messaging store daemon, umestored, using the ume-example-config.xml configuration file shipped with this sample.

  2. Open a terminal window on UNIX, or a StreamBase Command Prompt 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.

  3. 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 Maven>Update Project from the context menu.

  4. Open the src/main/eventflow/packageName folder.

  5. Open the persistence-source.sbapp file and click the Run button. This opens the SB Test/Debug perspective and starts the module.

  6. 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.

  7. Observe two "UME store registation" tuples on the PublishStatus stream indicating the source application, persistence-source.sbapp has registered with the UME store, umestored.

  8. 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.

  9. 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.

  10. Press F9 or click the Terminate EventFlow Fragment button to simulate a source failure.

  11. Click the Run button to restart the source application.

  12. 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 the PublishStatus stream reflect the new sequence number as well.

  13. When done, press F9 or click the Terminate EventFlow Fragment button.

Receiver Recovery

  1. Start the Ultra Messaging store daemon, umestored, using the ume-example-config.xml configuration file shipped with this sample.

  2. 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 Maven>Update Project from the context menu.

  3. Open the src/main/eventflow/packageName folder.

  4. Open the persistence-receiver.sbapp file and click the Run button. This opens the SB Test/Debug perspective and starts the module.

  5. 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.

  6. 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.

  7. In the Manual Input view enter false in the Subscribe field and click Send Data to simulate a receiver failure.

  8. Observe the stream of MessagesReceived tuples stop. Note the sequence number of the last MessagesReceived tuple.

  9. Click Clear to clear the displayed tuples in the Applicaton Output view.

  10. In the Manual Input view enter true in the Subscribe field and click Send Data.

  11. Observe a burst of MessagesReceived tuples that were published during the receiver failure. Observe the sequence number of the first MessagesReceived tuple in the burst is one more than that of the last received message before the failure.

  12. In the Manual Input view enter false in the Subscribe field and click Send Data to simulate another receiver failure.

  13. In the Manual Input view enter true in the Subscribe field and zero in the RecoverySequenceNumber field and click Send Data.

  14. 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.

  15. When done, press F9 or click the Terminate EventFlow Fragment button.

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_29west-lbm

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