platypush.plugins.kafka

class platypush.plugins.kafka.KafkaPlugin(server=None, port=9092, **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, port=9092, **kwargs)[source]
Parameters
  • server (str) – Default Kafka server name or address. If None (default), then it has to be specified upon message sending.

  • port (int) – Default Kafka server port (default: 9092).

send_message(msg, topic, server=None)[source]
Parameters
  • msg – Message to send - as a string, bytes stream, JSON, Platypush message, dictionary, or anything that implements __str__

  • topic (str) – Topic to send the message to.

  • server (str) – Kafka server name or address + port (format: host:port). If None, then the default server will be used