IBM Streams Event Streams integration
Project description
Overview
Provides functions to read messages from Event Streams as a stream and publish tuples to Event Streams as messages.
IBM® Event Streams is a fully managed, cloud-based messaging service. Built on Apache Kafka, IBM Event Streams is a high-throughput, fault-tolerant, event management platform that helps you build intelligent, responsive, event-driven applications.
Sample
A simple hello world example of a Streams application publishing to a topic and the same application consuming the same topic:
from streamsx.topology.topology import Topology from streamsx.topology.schema import CommonSchema from streamsx.topology.context import submit, ContextTypes import streamsx.eventstreams as eventstreams import time def delay(v): time.sleep(5.0) return True topology = Topology('EventStreamsHelloWorld') to_evstr = topology.source(['Hello', 'World!']) to_evstr = to_evstr.as_string() # delay tuple by tuple to_evstr = to_evstr.filter(delay) # Publish a stream to Event Streams using HELLO topic eventstreams.publish(to_evstr, topic='HELLO') # Subscribe to same topic as a stream from_evstr = eventstreams.subscribe(topology, schema=CommonSchema.String, topic='HELLO') # You'll find the Hello World! in stdout log file: from_evstr.print() # finally submit the topology to a Streaming Analytics Service instance submit(ContextTypes.STREAMING_ANALYTICS_SERVICE, topology)
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for streamsx.eventstreams-1.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2088baaad2ce3fc7db4605f3237376e2eb08b6676ab610037171777a1731df13 |
|
MD5 | 8cec656910274e24dda006b570997b55 |
|
BLAKE2b-256 | ee7df952066b3a21d16cea86adb06ce854e520f16cac7021060b8a92853b64b4 |
Close
Hashes for streamsx.eventstreams-1.3.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d07949425a066c73beebe95410af77f76b8e8fdac35817fa6951505e1fd42a72 |
|
MD5 | 5cfc0fa7976da0e34e2a3f40cc2c0d4f |
|
BLAKE2b-256 | cb58f9d2f261363440e5878fd3e452c06261f5fd43cf15e2fd3bbb5a9143bbdf |