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: docs/consumer.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,6 +187,39 @@ If `force` is not `true`, then the method will throw an error if any `MessagesSt
187
187
188
188
The return value is `void`.
189
189
190
+
### `pause(topicPartitions)`
191
+
192
+
Pauses message consumption for specific topic-partitions. Pausing only prevents new fetch requests for the specified partitions. Messages that are already buffered in the stream's internal buffer may still be emitted after calling `pause()`. This method will throw an error if called before joining a consumer group or if the specified topic is not assigned to this consumer.
193
+
194
+
The parameter is an array of `TopicPartitions` objects, where each object has:
195
+
196
+
| Property | Type | Description |
197
+
| ---------- | ---------- | ------------------- |
198
+
| topic |`string`| The topic name. |
199
+
| partitions |`number[]`| Array of partitions |
200
+
201
+
The return value is `void`.
202
+
203
+
### `resume(topicPartitions)`
204
+
205
+
Resumes message consumption for specific topic-partitions that were previously paused. This method will throw an error if called before joining a consumer group or if the specified topic is not assigned to this consumer.
206
+
207
+
The parameter is an array of `TopicPartitions` objects (same structure as `pause()`).
208
+
209
+
The return value is `void`.
210
+
211
+
### `paused()`
212
+
213
+
Returns an array of all currently paused topic-partitions.
214
+
215
+
The return value is an array of `TopicPartitions` objects (same structure as `pause()`).
216
+
217
+
### `isPaused(topic, partition)`
218
+
219
+
Checks if a specific topic-partition is currently paused.
220
+
221
+
The return value is `boolean`.
222
+
190
223
## FAQs
191
224
192
225
### My consumer is not receiving any message when the application restarts
0 commit comments