RTPP Adapter Sample

This topic describes the use of the Real-Time Payment Protocol (RTPP) Adapter suite in a sample application to illustrate the interaction between an RTPP client and server as they run transactions.[1]For more information about this adapter, see RTPP Adapter.

Sample Overview

This sample demonstrates the operators in the RTPP adapter suite:

  • Client and Server Control, which manage connections for the client and server side respectively

  • Client and Server Input, which receive RTPP messages and emit them as tuples to the application

  • Client and Server Output, which receive convert incoming tuples to RTPP messages and send them to the connected counterparty

Importing This Sample into StreamBase Studio

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

  • From the top-level menu, select File>Load StreamBase Sample.

  • Enter rtpp to narrow the list of options.

  • Select RTPP adapters from the resulting list.

  • Click Import Now.

StreamBase Studio creates a project for the RTPP adapter sample in your current Studio workspace.

Running This Sample in StreamBase Studio

The steps to run this sample in Studio are as follows:

  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 rtpp.sbapp file and click the Run button. This opens the SB Test/Debug perspective and starts the module. The client-side and server-side adapters are configured to automatically connect to each other upon startup of the application.

  4. Once the application has fully started, observe that a tuple was emitted by the ClientControl operator's ClientControlStatus stream, indicating that the connection with the server was successfully established (the tuple will have a 'Connected' value in its Status field).

  5. This tuple will trigger the construction and sending of a Credit Request message to the server, which will reply with a Credit Response. You can observe this interaction by looking at the traffic on the ClientMessagesSent, ServerMessagesReceived, ServerMessagesSent and ClientMessagesReceived streams, successively.

  6. You may also send new requests to the server by manually sending tuples to the SendToRTPPServer stream, although the server is only configured to respond to Credit Requests and will ignore any other type of message.

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

This Sample's Files

This sample has the following files:

  • The sample EventFlow application and its layout file, rtpp.sbapp and rtpp.sblayout, respectively, both located in src/eventflow.

  • The adapter configuration file, RTPP.conf, located in src/main/configurations.

  • This Readme file, in plain text and HTML formats.

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_rtpp

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



[1] The RTPP protocol was initially developed by LogicaCMG, now part of of the CGI Group.