pswamp.streaming.kafka_extras.consumer_producer
Attributes
Classes
Wrapper for Kafka consumer. |
|
Wrapper for Kafka producer. |
Functions
|
Module Contents
- pswamp.streaming.kafka_extras.consumer_producer.consumer_seek_relative_offset(consumer, relative_offset)
- class pswamp.streaming.kafka_extras.consumer_producer.KafkaConsumer(*args, use_nqkafka=False, **kwargs)
Wrapper for Kafka consumer.
- Parameters:
use_nqkafka (bool, optional) – Determines whether self.instance is a NQKafkaConsumer (from the nqkafka package, can be thought of as a “mock”) or actual KafkaConsumer (from the kafka-python package), which connects to a Kafka server. Defaults to False.
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- instance
Determined from input parameters.
- Type:
nqkafka.NQKafkaConsumerorkafka.KafkaConsumer
- instance
- __getattr__(name)
Inherits the same attributes as the instance.
- Parameters:
name (_type_) – Name of the attribute.
- Returns:
The attribute of the instance.
- __iter__()
The iterator is the same as the iterator of the instance.
- Returns:
The instance.
- class pswamp.streaming.kafka_extras.consumer_producer.KafkaProducer(*args, use_nqkafka=False, **kwargs)
Wrapper for Kafka producer.
- Parameters:
use_nqkafka (bool, optional) – Determines whether self.instance is a NQKafkaProducer (from the nqkafka package, can be thought of as a “mock”) or actual KafkaProducer (from the kafka-python package), which connects to a Kafka server. Defaults to False.
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- instance
Determined from input parameters.
- Type:
nqkafka.NQKafkaProducerorkafka.KafkaProducer
- instance
- __getattr__(name)
Inherits the same attributes as the instance.
- Parameters:
name (_type_) – Name of the attribute.
- Returns:
The attribute of the instance.
- __iter__()
The iterator is the same as the iterator of the instance.
- Returns:
The instance.
- pswamp.streaming.kafka_extras.consumer_producer.bootstrap_servers = 'localhost:9092'