-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,41 @@ | ||
[![Build Status](https://travis-ci.org/quintoandar/python-kafka-idempotence-client.svg?branch=master)](https://travis-ci.org/quintoandar/python-kafka-idempotence-client) | ||
[![Build Status](https://travis-ci.org/quintoandar/python-kafka.svg?branch=master)](https://travis-ci.org/quintoandar/python-kafka) | ||
|
||
# Idempotence Client for Kafka | ||
# Python Kafka | ||
|
||
Checks messages to avoid reprocessing events. | ||
QuintoAndar's kafka-python lib wrapper with additional fuctionalities. | ||
|
||
## Usage | ||
## KafkaConsumer | ||
|
||
A simple wrapper for kafka-python lib. | ||
|
||
### Configuration | ||
|
||
| Name | Description | | ||
| ----------------- | -------------------------------------------- | | ||
| group_id | The consumer group id | | ||
| bootstrap_servers | The bootstrap servers | | ||
| topic | The topic to consume from | | ||
| processor | The function that processes the event | | ||
| idempotenceClient | (optional) A client that checks for repeated events. Must implement the same interface as [IdempotenceClient](/clients/idempotence_client.py) | | ||
| deserializer | (optional) The deserializer | | ||
|
||
## IdempotenceClient for Kafka | ||
|
||
A redis implementation to check messages and avoid reprocessing events. | ||
|
||
### Usage | ||
|
||
`markConsumedMessage(topic, message)` creates a hash from the message and concatenates it with the topic and the group id. The message is reigstered as consumed with a default ttl of 2 weeks. | ||
|
||
`isUnique(message)` verifies if the message has already been processed. | ||
|
||
### Configuration | ||
|
||
| Name | Description | | ||
| ------------- | ------------------------------- | | ||
| host | The redis host | | ||
| port | The redis port | | ||
| groupId | The consumer group id | | ||
| db | (optional) The redis db option | | ||
| expire | (optional) The redis ttl | | ||
| key_extractor | (optional) A funtion that extracts a key that uniquely identifies the event | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters