Skip to content

Commit 5c5b3bd

Browse files
committed
fix: support new params for topic_data handler
1 parent d44ad54 commit 5c5b3bd

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/containers/Tenant/Diagnostics/TopicData/getData.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ export const generateTopicDataGetter = ({
6666

6767
const normalizedOffset = baseOffset + tableOffset;
6868

69-
const queryParams: TopicDataRequest = {...rest, partition, limit};
69+
const queryParams: TopicDataRequest = {
70+
...rest,
71+
partition,
72+
limit,
73+
last_offset: normalizedOffset + limit,
74+
};
7075
queryParams.offset = normalizedOffset;
7176

7277
const response = await window.api.viewer.getTopicData(queryParams);

src/services/api/viewer.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,14 @@ export class ViewerAPI extends BaseYdbAPI {
263263
}
264264

265265
getTopicData(params: TopicDataRequest, {concurrentId, signal}: AxiosOptions = {}) {
266-
return this.get<TopicDataResponse>(this.getPath('/viewer/json/topic_data'), params, {
267-
concurrentId,
268-
requestConfig: {signal},
269-
});
266+
return this.get<TopicDataResponse>(
267+
this.getPath('/viewer/json/topic_data'),
268+
{message_size_limit: '5000', ...params},
269+
{
270+
concurrentId,
271+
requestConfig: {signal},
272+
},
273+
);
270274
}
271275

272276
getConsumer(

src/types/api/topic.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,16 @@ export interface TopicDataRequest {
172172
partition: string;
173173
/** start offset to read from */
174174
offset?: number;
175+
/** last offset that can possibly be read */
176+
last_offset?: number;
175177
/** min message timestamp to read from */
176178
read_timestamp?: number;
177179
/** max number of messages to read (default = 10) */
178180
limit?: number;
179181
/** timeout in ms */
180182
timeout?: number;
183+
/** max size of single message (default = 1_000_000 (1 MB)) */
184+
message_size_limit?: number;
181185
}
182186

183187
export interface TopicDataResponse {

0 commit comments

Comments
 (0)