Wikimedia EventStreams Adapter Sample

Introduction

This topic describes how to run the sample application for the TIBCO StreamBase® WikiMedia EventStreams adapter, and demonstrates the processing of continuous streams of structured event data from one or more EventStreams web services associated with wikipedia.org.

The sample, wikiSample.sbapp, demonstrates a complete process of parsing EventStreams and how to use the Control Port to control the connection and disconnection of streams.

The addresses of the wikipedia.org EventStreams are built in to the adapter and do not need to be specified.

Importing This Sample into StreamBase Studio

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

  • From the top-level menu, select FileLoad StreamBase Sample.

  • Type Wiki to narrow the list of options.

  • Select Wikimedia EventStreams Adapter from the StreamBase Standard Adapters category.

  • Click OK.

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

Running this Sample in StreamBase Studio

Run this sample in Studio as follows:

  1. In the Package Explorer view, open the sample you just loaded.

  2. Double-click to open the wikiSample.sbapp application.

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

  4. In the Application Output view, look for different output streams.

  5. 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 cause the adapter to connect or disconnect to certain EventStreams, or to specify a new data starting time Since value.

The EventStream you address in the control port tuple must already be configured and present in the adapter. That is, you cannot use a control port tuple to add an EventStream that is not already in place.

Control Port Schema

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

    Valid values are:

    • Connect — Tells the adapter to connect to the EventStreamName URI specified in the control port's input tuple.

    • Disconnect — Tells the adapter to disconnect from the EventStreamName URI specified in the control port's input tuple (if a connection to that URI currently exists).

  • EventStreamName, string. The EventStream to connect to.

    Valid values are:

    • page-create

    • page-move

    • page-delete

    • recentchange

    • revision-create

    • page-undelete

    • page-properties-change

  • Since, string.

    • If provided, this timestamp is used as the historical starting position in each of the requested streams.

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_wiki

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