SPL File topics.spl

Topic based publish-subscribe model for streams. Supports a microservice architecture for Streams applications where streams are published to topics and can be subscribed to be independent applications. Use of interchange schema types allows applications to be implemented in different langauges, including SPL, Python, and Java.

Content

Operators
  • Publish: Publish a stream to a topic.
  • Subscribe: Subscribe to topics using a topic filter.
Functions

Composites

composite Publish(input In)

SPL composite operator image not displayed. Problem loading file: ../../image/tk$com.teracloud.streams.topology/op$com.teracloud.streams.topology.topic$Publish.svg

Publish a stream to a topic. Allows other Streams applications to subscribe to the input stream, including those written in different languages. See namespace:com.teracloud.streams.topology.topic for details.

Parameters

  • topic: Topic to publish stream to.
  • allowFilter: True if filters can be pushed from subscribing SPL applications. Optional, defaults to false.

Input Ports

  • In: Stream to be published as a topic.

composite Subscribe(output Topic)

SPL composite operator image not displayed. Problem loading file: ../../image/tk$com.teracloud.streams.topology/op$com.teracloud.streams.topology.topic$Subscribe.svg

Subscribe to topics using a topic filter. Generates a stream that is subscribed, through Streams dynamic connections, to all streams published to topics that match the topic filter topic and are an exact stream type match to streamType.

See namespace:com.teracloud.streams.topology.topic for details.

Parameters

  • topic: Topic filter to subscribe to.
  • streamType: Type of output stream Topic.
  • connect: Connection mode between subscriber and publishers. Can be set to Direct or Buffered. The default is Direct. See Connection mode.
  • bufferFullPolicy: Buffer policy when the buffer is full. Ignored when connect is set to Direct.
  • bufferCapacity: Capacity of the buffer in number of tuples. Ignored when connect is set to Direct.

Output Ports

  • Topic: Subscription to topic.

Functions

rstring getTopicSubscription(rstring topic)

Get the subscription that matches a topic for topic based subscription.

This is a low-level function that allows applications to build custom composites with functionality similar to Subscribe. The preference should be to use Subscribe where possible.

Parameters

  • topic: Topic to subscribe to.

Returns

  • rstring

rstring addUDPSubscription(rstring subscription)

Take a subscription and modify it to account for parallel regions in the publisher or subscriber.

This is a low-level function that allows applications to build custom composites with functionality similar to Subscribe or FilteredSubscribe. The preference should be to use Subscribe or FilteredSubscribe where possible.

Parameters

  • subscription: Base subscription.

Returns

  • rstring

int32 setSubscribeSubscription(rstring subscription)

Set a subscription expression adding in UDP channel based matching if the subscriber is in a parallel region.

Parameters

  • subscription: Subscription to be set on input port connected to Import operator.

Returns

  • int32

boolean checkTopicName(rstring topic)

Check a topic name is valid.

Parameters

  • topic

Returns

  • boolean

boolean checkTopicFilter(rstring topic)

Check a topic filter is valid.

Parameters

  • topic

Returns

  • boolean