StreamBase-to-StreamBase Output Adapter

Introduction

The StreamBase-to-StreamBase output adapter runs within an upstream application, sending tuples to a downstream application. It is suitable for situations in which multiple data producers — upstream applications — wish to enqueue data to a single consumer. The producers can be stopped and started independently without affecting the consumer.

The adapter is configured with the host name and port of the downstream application as well as the name of the stream to read from. The adapter is configured by default to reconnect after a restart of the downstream application.

Properties

The following table explains the adapter properties that you can set in the Adapter Settings tab of the Properties view for an SBD2SBDOutput icon in the EventFlow canvas.

Property Data Type Description
Downstream host string The host name or IP address of the downstream application.
Downstream port string The TCP port number of the downstream application.
Downstream stream string The name of the stream to write to in the downstream application. If no stream with this name is present in the downstream application, or the stream's schema is incompatible with the schema configured in the adapter, the upstream application behaves as though the downstream application is inaccessible. The Reconnect Interval property determines whether the upstream application attempts to reconnect periodically until a compatible stream is present.
Downstream container string The name of the container in the downstream application that holds the Downstream stream designated in the previous field. The default entry is default.
Reconnect Interval (secs) int The period, in seconds, the upstream application waits between reconnection attempts after the downstream application fails or no compatible stream is present. Set this property to zero to disable reconnection. When reconnection is disabled, the downstream application must be started first and must have a compatible output stream from which the upstream application can read.
Enqueue buffer size (tuples) int The numbers of tuples to enqueue before tuples are sent to the downstream application.
Max enqueue buffer size (tuples) int The maximum size of the enqueue buffer before tuples are dropped. Enter -1 to disable this setting.
Enqueue flush interval (msecs) integer The flush interval of the enqueue buffer in milliseconds.
Use SSL checkbox Mark the checkbox if the connection to the downstream host uses secure SSL-based communication to the downstream server.
Authentication type Dropdown list Specifies the type of authentication to use when connecting to the downstream server. Options in the dropdown list are: No authentication, Basic authentication, and Client certificate authentication.
User name string For secure connections, the login name on the downstream host to authenticate as. Only one of User name or Keystore pathname can be specified.
Keystore file pathname string The path on the local machine to the file containing keystore information used for Client certificate authentication.
Password string The password for the User name or the keystore passphrase.
Schema matching Select either Identical structure required or match field names.

Identical structure required means that, in the schemas of the outgoing and incoming streams, each field must match in data type and sequence, but the field names do not have to match. For fields of type tuple, their fields must also match in type and sequence.

Match field names, the default setting, means that fields in the outgoing stream are matched by name against fields in the incoming stream. Fields whose names match must have the same data type in both streams. Any fields in the outgoing schema whose names don't match the incoming schema are not streamed. Any fields in the incoming schema whose names don't match anything in the incoming schema are set to null.

For example, consider an outgoing stream with schema (a int, b (x int, y int, z int)) that is connected to an incoming stream with schema (b (y int, z int), c int). The incoming stream does not see fields a or b.x. Fields b.y and b.z are passed from incoming to outgoing, and field c in the incoming stream is set to null.

Explict URI (Advanced) string This option is for advanced users who have a standard StreamBase URI they use in other parts of the StreamBase application. Use this option to paste in a full StreamBase URI to the downstream application, including security connection information. If this field is used the following fields must be blank: Downstream host, port, stream, and container; User name; Keystore file pathname; and password.
Enable event port checkbox

Mark this checkbox to enable an output port that receives connection-up and connection-down events. The schema of the event output port is as follows:

  • EventType — currently always "Connection"

  • Object — contains the URL of the downstream sbd instance

  • Action — contains UP or DOWN to indicate the state of the connection with the downstream sbd

  • Info — contains a human-readable description of the event. For example, "Connection to sb://localhost:10001 is UP"

Typechecking and Error Handling

Typechecking fails if the Downstream Host or Downstream Stream properties are empty or if the Downstream Port property contains an illegal TCP port number (unless the Explicit URI field is used instead).

The behavior in response to errors depends upon the setting of the Reconnect Interval property. When configured to reconnect, the upstream application polls periodically until the downstream application is accessible and contains an output stream with an identical name and schema. Otherwise, the upstream application emits an error message and makes no further attempts to connect to the downstream application.

Suspend/Resume Behavior

When suspended, the adapter stops sending tuples to the downstream application. Note that doing so may cause the application to drop the connection with the downstream application, resulting in lost tuples. Upon resuming, the adapter reconnects to the downstream application, if necessary and configured to do so, and begins sending tuples. If the adapter is configured not to reconnect with the downstream application and the connection is dropped during the suspension, the application will not enqueue tuples to the downstream application upon resume