ProducerGroup

class openmsistream.kafka_wrapper.ProducerGroup(config_path, kafkacrypto=None, **kwargs)

Bases: LogOwner

Class for working with a group of producers sharing a single kafkacrypto.KafkaCrypto instance

Parameters:
property kafkacrypto

The KafkaCrypto object handling key passing and serialization for encrypted messages

get_new_producer()

Return a new OpenMSIStreamProducer object. Call this function from a child thread to get thread-independent Producers. Note: this function just creates the Producer; closing it etc. must be handled by whatever calls this function.

Returns:

a Producer created using the config set in the constructor

Return type:

OpenMSIStreamProducer

close()

Wrapper around kafkacrypto.KafkaCrypto.close().

classmethod get_command_line_arguments()

Anything extending this class should be able to access the “treat_undecryptable_as_plaintext” flag

classmethod get_init_args_kwargs(parsed_args)

Get the list of init arguments and the dictionary of init keyword arguments for this class given a namespace of, for example, parsed arguments.

Parameters:

parsed_args (argparse.Namespace) – A namespace containing entries needed to determine the init args and kwargs for this class

Returns:

A list of init args

Returns:

A dictionary of init kwargs