platypush.plugins.kafka

class platypush.plugins.kafka.KafkaPlugin(server=None, **kwargs)[source]

Plugin to send messages to an Apache Kafka instance (https://kafka.apache.org/)

Triggers:

Requires:

  • kafka (pip install kafka-python)
__init__(server=None, **kwargs)[source]
Parameters:server (str) – Default Kafka server name or address + port (format: host:port) to dispatch the messages to. If None (default), then it has to be specified upon message sending.
send_message(msg, topic, server=None, **kwargs)[source]
Parameters:
  • msg – Message to send - as a string, bytes stream, JSON, Platypush message, dictionary, or anything that implements __str__
  • server (str) – Kafka server name or address + port (format: host:port). If None, then the default server will be used