LiveView Publish Output Adapter

Introduction

The StreamBase LiveView publish output adapter allows a StreamBase application to publish data to LiveView tables.

Properties

This section describes the properties you can set for this adapter, using the various tabs of the Properties view for the adapter's icon in StreamBase Studio.

General Tab

Name: Use this field to specify or change the component's name, which must be unique in the application. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. The first character must be alphabetic or an underscore.

Adapter Name: A read-only field that shows the formal name of the adapter.

Class: A field that shows the fully qualified class name that implements the functionality of this adapter. Use this class name when loading the adapter in StreamSQL programs with the APPLY JAVA statement. You can right-click this field and select Copy from the context menu to place the full class name in the system clipboard.

Start with application: If this field is set to Yes or a module parameter that evaluates to true, an instance of this adapter starts as part of the containing StreamBase Server. If this field is set to No or a module parameter that evaluates to false, the adapter is loaded with the server, but does not start until you send an sbadmin resume command, or start the component with StreamBase Manager. With this option No or false, the adapter does not start even if the application as a whole is suspended and later resumed. The recommended setting is selected by default.

Enable Error Output Port: Select this check box to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports and Error Streams to learn about Error Ports.

Description: Optionally enter text to briefly describe the component's purpose and function. In the EventFlow canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.

Adapter Properties Tab

This section describes the properties on the Adapter Properties tab in the Properties view for the LiveViewPublish adapter.

Property Description
Set Server URI to encapsulating LiveView When checked the adapter must be part of a LiveView project. The adapter will connect to whatever port number the running LiveView server is running.
LiveView Server URI A LiveView server URI. For example, the local machine and default port is lv://localhost:10080.
Get table name from input The first field of the input port must be a string and contain the table name
Target Table Name The name of the LiveView table to issue the queries
Enforce Strict Schema If checked the input port schema must exactly match the configured table schema
Connect Inline A reconnector background thread continuously tries to connect to the configured server. However, a timing window can occur when the server is up, but the reconnector is waiting to retry. Setting this option means if the adapter is not currently connected, it tries to connect inline each time a tuple is sent. This can cause long application delays while the connection is attempted.
Publisher Buffer Size The number of tuples to buffer before forcing a network write.
Publisher Flush Interval (ms) The maximum number of milliseconds a tuple will wait before sending written to the network.

Concurrency Tab

Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.

Caution

Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.

Using the Adapter in a StreamBase Application

The StreamBase LiveView Publish adapter has an input port that supplies tuple to be published to the target table, and a status port to provide information about connection status.

As with other StreamBase adapters and operators, you can optionally enable an Error Output Port, as described in Using Error Ports and Error Streams.

LiveView Publish Adapter Output Port

You must supply the exact schema of the target LiveView table to the PublishIn port.

Field Data Type Description
<TableFieldNames> <matchingType> The input schema of this port must exactly match the schema of the target table.

LiveView Publish Adapter Output Ports

The StreamBase LiveView Publish adapter has one output status port. The status port has the following fields:

Field Data Type Description
Type string The basic state reported, always one of the following:
CONNECTION PUBLISH
ERROR  
Object string The name on the EventFlow canvas of the adapter reporting the status.
Action string The action that occurred, one of the following:
CONNECTED ERROR
FAILED  
Message string A human-readable string that provides additional context for the status message.
Time timestamp The time the action occurred.

Adding the Adapter to an EventFlow Application

Add an instance of the adapter to a new StreamBase EventFlow application as follows:

  1. In StreamBase Studio, create a project, including an empty StreamBase EventFlow Application file to host the adapter.

  2. From the Operators and Adapters drawer of the Palette view, drag the Output Adapter icon to the palette. This opens the Insert Output Adapter dialog.

  3. In the search field, type a string such as LiveView to narrow the list of adapters. When found, select the icon for the LiveView Publish adapter, then click OK.

  4. Double-click the adapter icon and select the Adapter Properties tab in the Properties view. You must provide the LiveView URI, table name, and table schema.

  5. Select the Edit Schemas tab. You must provide the schema of the LiveView table. The generated LiveView interfaces file will have the schema for the table.

Typechecking and Error Handling

The StreamBase LiveView Publish adapter uses typecheck messages to help you configure the adapter.

The adapter generates warning messages at runtime under various conditions, including:

  • The configured schema of this adapter does not match the LiveView table

  • The configured LiveView server is not available.

Suspend and Resume Behavior

When suspended, the adapter stays connected to the LiveView server.

Related Topics