Skip to content

UDP

Spout for UDP

Bases: Spout

__init__(output, state, **kwargs)

Initialize the Udp 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 Udp rise \
    streaming \
        --output_kafka_topic udp_test \
        --output_kafka_cluster_connection_string localhost:9094 \
    none \
    listen \
        --args host=localhost port=12345

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_udp_spout:
        name: "Udp"
        method: "listen"
        args:
            host: "localhost"
            port: 12345
        output:
            type: "streaming"
            args:
                output_topic: "udp_test"
                kafka_servers: "localhost:9094"

listen(host='localhost', port=12345)

📖 Start listening for data from the UDP server.

Parameters:

Name Type Description Default
host str

The UDP server host. Defaults to "localhost".

'localhost'
port int

The UDP server port. Defaults to 12345.

12345

Raises:

Type Description
Exception

If unable to connect to the UDP server.