Example

Toolkits > com.ibm.streamsx.eventstore 1.2.0 > com.ibm.streamsx.eventstore > EventStoreSink > Example

SPL example demonstrates the usage of the EventStoreSink operator:

composite Main {
    param
        expression<rstring> $connectionString: getSubmissionTimeValue("connectionString");
        expression<int32>   $batchSize: (int32)getSubmissionTimeValue("batchSize", "1000");
        expression<rstring> $databaseName: getSubmissionTimeValue("databaseName");
        expression<rstring> $tableName: getSubmissionTimeValue("tableName");
        expression<rstring> $eventStoreUser: getSubmissionTimeValue("eventStoreUser", "");
        expression<rstring> $eventStorePassword: getSubmissionTimeValue("eventStorePassword", "");

    graph

        stream<rstring key, uint64 dummy> Rows = Beacon() {
            param
                period: 0.01;
            output
                Rows : key = "SAMPLE"+(rstring) IterationCount();
        }

        () as Db2EventStoreSink = com.ibm.streamsx.eventstore::EventStoreSink(Rows) {
            param
                batchSize: $batchSize;
                connectionString: $connectionString;
                databaseName: $databaseName;
                primaryKey: 'key';
                tableName: $tableName;
                eventStoreUser: $eventStoreUser;
                eventStorePassword: $eventStorePassword;
        }
}