BackpackDispatcher

class sasquatchbackpack.sasquatch.BackpackDispatcher(source, redis_address='default')

Bases: object

A class to send backpack data to kafka.

Parameters:
  • source (DataSource) – DataSource containing schema and record data to be posted to remote

  • config (DispatcherConfig) – Item that transmits other relevant information to the Dispatcher

  • redis_address (str, default: 'default')

Methods Summary

post(*[, force_post])

Assemble schema and payload from the given source, then makes a POST request to kafka.

Methods Documentation

post(*, force_post=False)

Assemble schema and payload from the given source, then makes a POST request to kafka.

Parameters:

force_post (bool) – Ignore checks to determine whether a topic exists and push a new topic name, overwriting any extant topic names.

Returns:

response – stringified json containing the following key value pairs: “succeeded”: bool - True if the post succeeded, False if any relevant steps failed. “records”: list - List of posted records. “requests”: dict[str, dict[str, str]] The results of various POST requests sent by this function. Empty values denote a POST request that has not occurred.The keys withn this dictionary are: “check_topic”, create_topic”, “write_values”: dict[str, str]. Each contains the following values: status”: str - “Success” if request suceeded, “Error” if request failed, “Warning” for other non-breaking behavior. “message”: str - Specific description of what occured.

Return type:

str