Diameter Protocol Client and Server Adapter Samples

About the Samples

In this sample, the following adapters are demonstrated:

  1. Spotfire Streaming Diameter client input adapter

  2. Spotfire Streaming Diameter client output adapter

  3. Spotfire Streaming Diameter client controller adapter

  4. Spotfire Streaming Diameter server input adapter

  5. Spotfire Streaming Diameter server output adapter

  6. Spotfire Streaming Diameter server controller adapter

The Diameter protocol is an authentication, authorization, and accounting protocol for computer networks that evolved from and replaces the RADIUS protocol that preceded it.

The Diameter adapters are used to communicate with other Diameter-enabled applications over a TCP or SCTP connection. The adapters follow the RFC 6733 specification.

This sample includes a server and client version of the adapters and when started, the client automatically connects to the server and sends a CER (Capabilities-Exchange-Request) message, which the server processes and returns a CEA (Capabilities-Exchange-Answer) message. The device watchdog messages are automatically handled and are sent between the adapters when no messages were sent for a configured period of time.

This demo also shows how you can create a new Diameter message type by updating the dictionary and creating the EventFlow to do so. The TestDictionary.json file contains a demo message set up with a demo vendor and application. This message is then used in the EventFlow. The client sends a request and the server returns an answer. The message sends a simple list of strings in field, DemoField1, and a simple string in field, DemoField2.

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 diam to narrow the list of options.

  • Select Diameter protocol adapters from the StreamBase Messaging Adapters category.

  • Click Import Now.

StreamBase Studio creates a single project containing the sample files.

Running This Sample in StreamBase Studio

  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/java/packageName folder.

    The SectionedApp.sbapp file is the upper level application that contains module references to SectionedClient.sbapp and SectionedServer.sbapp, which are the client and server implementations.

  3. Open the SectionedApp.sbapp file and click the Run button. This opens the SB Test/Debug perspective and starts the module.

  4. In the Output Streams view, observe tuples emitted on multiple output streams. Each stream corresponds to a specific Diameter message type.

  5. In the Manual Input view, select the SendDemoCommand stream, then press the Send Data button to push a tuple into the EventFlow module. You do not need to fill out any fields in the Manual Input view because the EventFlow module contains a Map operator, StartDemoCommandRequestDefaults that supplies default values required to send this message request.

  6. Select the tuple emitted from one of the streams, then use the triangles next to the data fields displayed to analyze and understand their structure.

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

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_diameter

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