320
}
321
322
>
func (ac *DLQV2Service) findLastMessageIDFromListQueues(c *cli.Context) (int64, bool, error) {
dlq_v2_service.go
323
>
ctx, cancel := newContext(c)
324
>
defer cancel()
325
>
326
>
adminClient := ac.clientFactory.AdminClient(c)
327
>
328
>
// Use ListQueues to find our specific DLQ and get its LastMessageID
329
>
dlqKey := ac.getDLQKey()
330
>
queueName := persistence.GetHistoryTaskQueueName(int(dlqKey.TaskCategory), dlqKey.SourceCluster, dlqKey.TargetCluster)
331
>
332
>
var nextPageToken []byte
333
>
for {
334
>
resp, err := adminClient.ListQueues(ctx, &adminservice.ListQueuesRequest{
335
>
QueueType: int32(persistence.QueueTypeHistoryDLQ),
336
>
PageSize: int32(defaultPageSize),
337
>
NextPageToken: nextPageToken,
338
>
})
339
>
if err != nil {
340
return 0, false, fmt.Errorf("call to ListQueues from findLastMessageIDFromListQueues failed: %w", err)
341
}