You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+79-5
Original file line number
Diff line number
Diff line change
@@ -74,15 +74,16 @@ Note: `int` is used for brevity but can also mean `long`. Don't worry about it.
74
74
|:internal-config| map | optional | A map of the underlying java client properties, for any extra lower level config |
75
75
76
76
#### Consumer-source options
77
-
| Key | Type | Req? | Notes |
78
-
|-----|------|------|-------|
79
-
|:group-id| string | required ||
80
-
|:shape|`:value:`, `[:vector <fields>]`,`[:map <fields>]`, or an arity-1 function of `ConsumerRecord`| optional | If unspecified, channel will contain ConsumerRecord objects. [Examples](#data-shapes)|
|:shape|`:value:`, `[:vector <fields>]`,`[:map <fields>]`, or an arity-1 function of `ConsumerRecord`| optional | If unspecified, channel will contain ConsumerRecord objects. [Examples](#data-shapes)|
81
+
|:ketu.source/consumer-commands-chan | channel | optional | Used for passing custom functions to be executed from within the poll loop. Items of this channel are expected to be of type `fn[x]`. One example for using this channel is to enable pausing/resuming of the underlying kafka consumer, since trying to do that outside the poll loop causes a `ConcurrentModificationException` to be thrown. [Code example](#data-shapes)|
81
82
82
83
#### Producer-sink options
83
84
| Key | Type | Req? | Notes |
84
85
|-----|------|------|-------|
85
-
|:shape|`:value`, `[:vector <fields>]`,`[:map <fields>]`, or an arity-1 function of the input returning `ProducerRecord`| optional | If unspecified, you must put ProducerRecord objects on the channel. [Examples](#data-shapes)|
86
+
|:shape|`:value`, `[:vector <fields>]`,`[:map <fields>]`, or an arity-1 function of the input returning `ProducerRecord`| optional | If unspecified, you must put ProducerRecord objects on the channel. [Examples](#example-of-using-the-custom-commands-channel)|
86
87
|:compression-type|`"none"``"gzip"``"snappy"``"lz4"``"zstd"`| optional | Default `"none"`, values are same as "compression.type" of the java producer |
87
88
|:workers| int | optional | Default `1`, number of threads that take from the channel and invoke the internal producer |
88
89
@@ -127,6 +128,79 @@ Similarly, to put a clojure data structure on the producer channel:
127
128
(>!! producer-chan ["k2""v2""events"])
128
129
```
129
130
131
+
## Example of using the custom commands channel
132
+
133
+
In this example we demonstare how to enable pause/resume of the consumer:
0 commit comments