SMPP Adapter Sample

Introduction

This topic describes how to run the sample application for the TIBCO StreamBase® Short Message Peer-to-Peer Protocol (SMPP) Adapter.

The sample, SMPPSimpleSample.sbapp, demonstrates how to connect to a message center and send short messages.

Importing This Sample into StreamBase Studio

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

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

  • Enter SMPP to narrow the list of options.

  • Select Short Message Peer-to-Peer Protocol (SMPP) Adapter from the StreamBase Standard Adapters category.

  • Click OK.

StreamBase Studio creates a single project for the SMPP adapter samples in your current Studio workspace.

Running the SMPP Sample in StreamBase Studio

Run this sample in Studio as follows:

  1. In the Project Explorer view, open this sample's folder.

    Keep an eye on the bottom right status bar of the Studio window. Make sure any Updating, Downloading, Building, or Rebuild project messages finish before you proceed.

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

  3. Double-click to open the SMPPSimpleSample.sbapp application.

  4. Make sure the application is the currently active tab in the EventFlow Editor, then click the Run button. This opens the SB Test/Debug perspective and starts the application.

  5. In the Manual Input view, select the ControlInput stream and type connect in the command field.

    1. In the Fields section, enter an instanceId or let the sample generate one for you.

    2. Enter your information (host, port, and so on) to connect to an External Short Message Entity (ESME) or Message Center (MC).

  6. Click Send Data. In the Output Streams view, look for the Connected at control status output.

  7. In the Manual Input view, select the DataInput stream.

    1. Click the plus sign next to (list) to expand the data Elements fields.

    2. In the Fields section: enter either the instanceId you supplied earlier, or the instanceId that the sample generated for you.

    3. Enter a simple message as well as the sender and destination information.

  8. Click Send Data. In the Output Streams view, look for Message Submitted and Delivery (if the delivery report is enabled on the server side) at data status output.

  9. In the Manual Input view, select the ControlInput stream.

    • Enter disconnect into the command field.

    • Enter the same instanceId as before.

  10. Click Send Data. In the Output Streams view, look for the Disconnected status output.

  11. When done, press F9 or click the Stop Running Application button.

Control Port

Description

Use the control port to send action commands to the adapter. Tuples enqueued on this port connect or disconnect the adapter to the message center, as well as list all existing sessions.

Control Port Schema

Command, string: the command to send to the adapter.

The values are:

  • Connect — Notifies the adapter to connect to External Short Message Entity (ESME) or Message Center (MC).

  • Disconnect — Notifies the adapter to disconnect from the External Short Message Entity (ESME) or Message Center (MC) (if a connection to that URI already exists).

  • List — Lists all existing sessions.

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_SMPP

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