Contents
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.
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
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, select
> . -
Enter
rtpp
to narrow the list of options. -
Select RTPP adapters from the resulting list.
-
Click
.
StreamBase Studio creates a project for the RTPP adapter sample in your current Studio workspace.
The steps to run this sample in Studio are as follows:
-
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
-
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. -
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 itsStatus
field). -
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
andClientMessagesReceived
streams, successively. -
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. -
When done, press F9 or click the Terminate EventFlow Fragment button.
This sample has the following files:
-
The sample EventFlow application and its layout file,
rtpp.sbapp
andrtpp.sblayout
, respectively, both located insrc/eventflow
. -
The adapter configuration file,
RTPP.conf
, located insrc/main/configurations
. -
This
Readme
file, in plain text and HTML formats.
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.