BackpackDispatcher#
- class sasquatchbackpack.sasquatch.BackpackDispatcher(source, redis_address='default', broker_in=None)#
Bases:
object
A class to send backpack data to kafka.
- Parameters:
source (DataSource) – DataSource containing schema and record data to be published to remote
redis_address (str) – Location to look for a redis server. Will look for one if left empty, used for testing.
broker_in (faststream.kafka.KafkaBroker) – Reference to a preconfigured broker. Will create one if left empty, used for testing.
Methods Summary
Create kafka topic based off data from provided source.
publish
(*[, method])Assemble a schema and payload from the given source, and route data directly to kafka.
Methods Documentation
- create_topic()#
Create kafka topic based off data from provided source.
- Returns:
response text – The results of the requests in string format
- Return type:
- publish(*, method=PublishMethod.DIRECT_CONNECTION)#
Assemble a schema and payload from the given source, and route data directly to kafka.
- Return type:
- Returns:
response (str) – Status message for the operation.
records (list) – List of entries with those already stored on remote removed
- Parameters:
method (
PublishMethod
, default:<PublishMethod.DIRECT_CONNECTION: 'DIRECT_CONNECTION'>
)