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
+12-16Lines changed: 12 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,41 +183,37 @@ If `force` is not `true`, then the method will throw an error if any `MessagesSt
183
183
184
184
The return value is `void`.
185
185
186
-
### `pause(partitions)`
186
+
### `pause(topicPartitions)`
187
187
188
-
Pauses message consumption for specific topic-partitions.
188
+
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.
189
189
190
-
The parameter is an array of `TopicPartition` objects, where each object has:
190
+
The parameter is an array of `TopicPartitions` objects, where each object has:
| partition |`number`| The partition number to pause |
196
-
197
-
**Important:** 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()`.
192
+
| Property | Type | Description |
193
+
| ---------- | ---------- | ------------------- |
194
+
| topic |`string`| The topic name. |
195
+
| partitions |`number[]`| Array of partitions |
198
196
199
197
The return value is `void`.
200
198
201
-
### `resume(partitions)`
199
+
### `resume(topicPartitions)`
202
200
203
-
Resumes message consumption for specific topic-partitions that were previously paused.
201
+
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.
204
202
205
-
The parameter is an array of `TopicPartition` objects with the same structure as `pause()`.
203
+
The parameter is an array of `TopicPartitions` objects (same structure as `pause()`).
206
204
207
205
The return value is `void`.
208
206
209
207
### `paused()`
210
208
211
209
Returns an array of all currently paused topic-partitions.
212
210
213
-
The return value is an array of `TopicPartition` objects.
211
+
The return value is an array of `TopicPartitions` objects (same structure as `pause()`).
214
212
215
-
### `isPaused(partition)`
213
+
### `isPaused(topic, partition)`
216
214
217
215
Checks if a specific topic-partition is currently paused.
0 commit comments