Skip to content

SNS

Spout for SNS

Bases: Spout

__init__(output, state, **kwargs)

Initialize the SNS class.

Parameters:

Name Type Description Default
output StreamingOutput

An instance of the StreamingOutput class for saving the data.

required
state State

An instance of the State class for maintaining the state.

required
**kwargs

Additional keyword arguments.

{}

Using geniusrise to invoke via command line

genius SNS rise \
    streaming \
        --output_kafka_topic sns_test \
        --output_kafka_cluster_connection_string localhost:9094 \
    none \
    listen

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_sns_spout:
        name: "SNS"
        method: "listen"
        output:
            type: "streaming"
            args:
                output_topic: "sns_test"
                kafka_servers: "localhost:9094"

listen()

📖 Start the asyncio event loop to listen for data from AWS SNS.