Producible

class openmsistream.kafka_wrapper.Producible

Bases: ABC

Small utility class for anything that can be Produced as a message to a topic

abstract property msg_key

The key of the object when it’s represented as a message. This can be something that needs to be serialized still

Not implemented in base class

abstract property msg_value

The value of the object when it’s represented as a message. This can be something that needs to be serialized still

Not implemented in base class

property callback_kwargs

A dictionary of keyword arguments that should be sent to the callback function for Producers producing messages of this Producible

Empty for the base class

abstract get_log_msg(print_every=None)

Given some (optional) “print_every” variable, return the string that should be logged (at debug level) for this message. If “None” is returned (the default) nothing will be logged.