StreamBase-to-StreamBase Input Adapter

Introduction

The StreamBase-to-StreamBase input adapter runs within a downstream application, reading tuples from an upstream application. It is suitable for situations in which multiple data consumers — downstream applications — wish to read data from a single producer. The consumers can be stopped and started independently without affecting the producer.

The adapter is configured with the host name and port of the upstream 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 upstream application.

Properties

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

Property Data Type Description
Upstream host string The host name or IP address of the upstream application.
Upstream port string The TCP port number of the upstream application.
Upstream stream string The name of the stream to read from in the upstream application. If no stream with this name is present in the upstream application, or the stream's schema is incompatible with the schema configured in the adapter, the downstream application behaves as though the upstream application is inaccessible. The Reconnect Interval property determines whether the downstream application attempts to reconnect periodically until a compatible stream is present.
Upstream container string The name of the container in the upstream application that holds the Upstream stream designated in the previous field. The default entry is default.
Reconnect Interval (secs) int The period, in seconds, the downstream application waits between reconnection attempts after the upstream application fails or no compatible stream is present. Set this property to zero to disable reconnection. When reconnection is disabled, the upstream application must be started first and must have a compatible output stream from which the downstream application can read.
Use SSL checkbox Mark the checkbox if the connection to the upstream host uses secure SSL-based communication to the upstream server.
Authentication type Dropdown list Specifies the type of authentication to use when connecting to the upstream 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 upstream 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 upstream application, including security connection information. If this field is used the following fields must be blank: Upstream host, port, stream, and container; User name; Keystore file pathname; and password.
Enable event port checkbox

Mark this checkbox to enable a second 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 upstream sbd instance

  • Action — contains UP or DOWN to indicate the state of the connection with the upstream 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 Upstream Host or Upstream Stream properties are empty or if the Upstream Port property contains an illegal TCP port number (unless the Explicit URI field is used).

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

Suspend/Resume Behavior

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