Operator EndpointSource

Primitive operator image not displayed. Problem loading file: ../../image/tk$spl/op$spl.endpoint$EndpointSource.svg

The EndpointSource operator enables data exchange between a Streams job and external clients. It accepts input data items from external clients, converts them to tuples, and submits them on its output ports. A management data service is started when an instance is started. This service accepts REST API POST requests to send input data to EndpointSource operators. An EndpointSource operator can have one or more output ports, each corresponding to an endpoint and each with a corresponding REST API URL.

A separate buffer is used for reading input data for each endpoint. The buffer size is configurable to accommodate the flow of data through the operator. All ports in an operator share the same buffer size. To use different buffer sizes for different endpoints, add multiple EndpointSource operators with different buffer sizes.

The @endpoint annotation can be used on an EndpointSource operator to provide customized content that is included with the generated API documentation for the endpoint. A description of the endpoint can be provided as well as descriptions for the tuple attributes.

Note: This operator currently is not supported in a consistent region or in a parallel region.

For more information, see the product documentation on enabling Streams data exchange.

Example

This example uses the EndpointSource operator.


composite Main {
    graph
        @endpoint (port=Operands, summary="Number injector", tags="[\"Calculator\"]", description="Feeds in numeric values",
                   attributeDescriptions="{\"x\": { \"description\": \"first operand\" }, \"y\":  { \"description\": \"second operand\" }  }")
        (stream<int32 x, int32 y> Operands) as NumericInput = EndpointSource() {
            param bufferSize : 20;
        }
        (stream<int32 z> result) as sum = Custom(Operands) {
            logic
                onTuple Operands: {
                    mutable result oTuple = {};
                    oTuple.z = Operands.x + Operands.y;
                    submit(oTuple, result);
                }
        }
}

Summary

Ports
This operator has 0 input ports and 1 or more output ports.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports 1 parameter.

Optional: bufferSize

Metrics
This operator does not report any metrics.

Properties

Implementation
Java

Output Ports

Assignments
Java operators do not support output assignments.
Ports (0)

Properties

Ports (1...)

Properties

Parameters

This operator supports 1 parameter.

Optional: bufferSize

bufferSize

Identifies the size (in input data items) of each endpoint buffer. An input data item corresponds to one generated tuple. When the EndpointSource operator receives a request to add input data items, it buffers the data items and returns to the caller while processing the data. The buffer size should be at least as large as the maximum number of input data items sent on a single API call. If concurrent API requests are made, the size should to be larger. If the buffer size is not sufficient to hold all input data items, the available capacity is used and an error is returned with an indication of how many data items were not added. The default buffer size is 100.

Properties

Libraries

Operator class library
Library Path: ../../impl/lib/com.ibm.streams.endpoint.internal.jar