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
- Functions
-
- addUDPSubscription(rstring): Take a subscription and modify it to account for parallel regions in the publisher or subscriber.
- checkTopicFilter(rstring): Check if a topic filter is valid.
- checkTopicName(rstring): Check if a topic name is valid.
- getTopicSubscription(rstring): Get the subscription that matches a topic for topic based subscription.
- setSubscribeSubscription(rstring): Set a subscription expression adding in UDP channel-based matching if the subscriber is in a parallel region.
Composites
composite Publish(input In)
Publish a stream to a topic. Allows other Streams applications to subscribe to the input stream, including those written in different languages. See Publish-subscribe Overview for details.
Parameters
- topic: Required 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)
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 Publish-subscribe Overview for details.
Parameters
- topic: Required topic filter to subscribe to.
- streamType: Required Topic output stream type.
- 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 tuple stream.
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
- Subscription property string
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
- Updated subscription property string
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
- 0 if successful; otherwise, program is aborted
boolean checkTopicName(rstring topic)
Check if a topic name is valid.
Parameters
- topic: Topic name to validate
Returns
- true if valid; false
boolean checkTopicFilter(rstring topic)
Check if a topic filter is valid.
Parameters
- topic: Topic filter to validate
Returns
- true if valid; false