Contents
The StreamBase .NET client sample contains three C# and one VB.NET applications that enqueue tuples to, and dequeue tuples from, a StreamBase application. The StreamBase application performs a simple Map operation on the incoming tuples. While the operation is trivial, the sample demonstrates how the StreamBase .NET Client library enables client applications to be created in a .NET-compatible language that runs with a StreamBase application.
Note
The .NET Client library and this sample are only available in the StreamBase installation for Microsoft Windows. You can run the pre-built samples without having Visual Studio .NET installed. However, they require version 4.0 or later of the .NET Framework, which can be downloaded from Microsoft's web site.
This topic describes the StreamBase .NET client sample.
The sample has the following files:
-
A StreamBase application,
dotnet.sbapp.
-
One enqueuer and three dequeuer programs that use the StreamBase .NET Client library.
-
Microsoft Visual Studio .NET solution and project files, which can be used to build all of the sample source code. (In the Visual Studio project files, the paths to the StreamBase include files and libraries are configured for the standard default installation directory. You may need to adjust these paths for your PC.)
To run this sample using StreamBase Studio:
Note
Running the forms-based sample dequeuer, bin\SimpleDequeuerForm.exe
, is not supported from StreamBase
Studio.
-
In the Package Explorer, double-click to open the
dotnet.sbapp
application. Make sure the application is the currently active tab in the EventFlow Editor. -
Click the
Run button. This opens the SB Test/Debug perspective and starts the application.
-
Open a StreamBase Command Prompt window, and navigate to the directory where the sample is installed, or to your workspace copy of the sample, as described above.
-
In the Command Prompt window, run the enqueuer by typing:
bin\SimpleEnqueuer.exe
-
Back in Studio, observe that ten tuples appear in the Application Output view.
-
In the Command Prompt window, run the dequeuer by typing:
bin\SimpleDequeuer.exe
orbin\SimpleDequeuerVB.exe
-
Back in Studio, in the Manual Input view, fill in the three fields and click
. -
Observe that a modified version of the tuple is dequeued by the simple dequeuer sample program running in the Command Prompt window.
-
When done, press F9 or click the
Stop Running Application button.
-
Open three StreamBase Command Prompt windows. In each window, navigate to the directory where the sample is installed, or to your workspace copy of the sample, as described above.
-
In window 1, run the StreamBase Server on
dotnet.sbapp
:sbd dotnet.sbapp
-
In window 2, enter one of the following commands to run the dequeuer:
-
Console dequeuer command:
bin\SimpleDequeuer.exe
orbin\SimpleDequeuerVB.exe
-
Windows form-based dequeuer command:
bin\SimpleDequeuerForm.exe
-
-
If you are using the form-based dequeuer, click
. -
In window 3, enter the following command to run the enqueuer:
bin\SimpleEnqueuer.exe
-
Observe that tuples are displayed by the dequeuer. In the case of the form-based dequeuer, the last tuple dequeued is displayed.
-
Run
sbadmin shutdown
to close the server.
In StreamBase Studio, import this sample with the following steps:
-
From the top menu, select
→ . -
Select this sample from the Applications list.
-
Click OK.
StreamBase Studio creates a project for the sample.
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 the permission problems that can occur when trying to work with the initially installed location of the sample. The default workspace location for this sample is:
studio-workspace
/sample_dotnet
See Default Installation
Directories for the location of studio-workspace
on your system.
In the default TIBCO StreamBase installation, this sample's files are initially installed in:
streambase-install-dir
/sample/dotnet
See Default Installation
Directories for the location of streambase-install-dir
on your system. This location
may require administrator privileges for write access, depending on your platform.