Skip to content

Commit

Permalink
cr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
idantavor committed Jul 31, 2024
1 parent e807f7e commit fb71cf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.0] - 2024-29-07
## [[1.1.0]](https://github.com/AppsFlyer/ketu/pull/18) - 2024-07-29

### Added
- consumer decorator support.
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Note: `int` is used for brevity but can also mean `long`. Don't worry about it.
|---------------------------------|-----------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| :group-id | string | required | |
| :shape | `:value:`, `[:vector <fields>]`,`[:map <fields>]`, or an arity-1 function of `ConsumerRecord` | optional | If unspecified, channel will contain ConsumerRecord objects. [Examples](#data-shapes) |
| :ketu.source/consumer-decorator | `fn [consumer-context pool-fn] -> [ConsumerRecord]` | optional | Decorates the internal pool function. when provided the decorator will be called with the following params:<br/>consumer-context: {:consumer-source/consumer consumer}<br/>pool-fn: fn [] -> ConsumerRecords <br/>Returns an iterable collection of consumerRecord.<br/>The decorator should call the poll-fn on behalf of the consumer source.<br/> |
| :ketu.source/consumer-decorator | `fn [consumer-context poll-fn] -> [ConsumerRecord]` | optional | Decorates the internal poll function. when provided the decorator will be called with the following params:<br/>consumer-context: {:consumer-source/consumer consumer}<br/>pool-fn: fn [] -> ConsumerRecords <br/>Returns an iterable collection of consumerRecord.<br/>The decorator should call the poll-fn on behalf of the consumer source.<br/> |

#### Producer-sink options

Expand Down Expand Up @@ -138,9 +138,10 @@ Similarly, to put a clojure data structure on the producer channel:
```

## Consumer Decorator
The consumer decorator allows running custom logic on the consumer polling thread.
This allows custom control on the consumer behavior including manual offset management.
Custom decorator logic may require different consumer configurations. for example when managing the offset manually, auto-commit should usually set to false.
The consumer decorator allows running custom logic on the consumer polling thread.
This allows custom control on the consumer behavior including manual offset management.
Custom decorator logic may require different consumer configurations.
for example when managing the offset manually, auto-commit should usually set to false.

In this example we demonstare how to enable pause/resume of the consumer:
```clojure
Expand Down

0 comments on commit fb71cf5

Please sign in to comment.