All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsDLQMessagePageQueryByGroupId

Last Updated:Jun 10, 2026

Mengkueri Paket dead-letter berdasarkan halaman untuk Group ID dan rentang pengatur waktu tertentu.

Deskripsi operasi

Penting

Alibaba Cloud OpenAPI is a management API. You can use it to manage and query Alibaba Cloud service resources. Integrate this API for management purposes only. Do not use this API for core data links that send and receive messages because this can create security threats.

  • Querying dead-letter messages by Group ID is a paged range query. This method applies only to scenarios in which you query messages without specifying a message ID.

  • When you query dead-letter messages by Group ID, specify a time range that is as short as possible. A long time range can return too many messages and make it difficult to identify issues. The call flow is as follows:

    1. For the first paged query, specify the Group ID, start time, end time, and the number of messages per page. If messages are found, the API returns the messages on the first page, the total number of pages, and a query task ID.

    2. Use the returned query task ID to retrieve more pages of messages. In subsequent requests, specify the query task ID and the page number. The start time, end time, and number of messages per page in these requests are ignored because the values from the first query are used.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

mq:QueryDLQMessage

get

Group

acs:mq:{#regionId}:{#accountId}:{#GroupName}

Group

acs:mq:{#regionId}:{#accountId}:{#InstanceId}%{#GroupName}

None
  • mq:OnsInstanceBaseInfo

Parameter permintaan

Parameter

Type

Required

Description

Example

GroupId

string

Yes

ID kelompok konsumen yang akan dikueri.

GID_test_group_id

BeginTime

integer

Yes

Awal rentang pengatur waktu yang akan dikueri. Nilai ini adalah Stempel waktu UNIX dalam milidetik. Jika Anda menentukan TaskId untuk mengambil lebih banyak halaman, parameter ini diabaikan. Waktu mulai dari kueri pertama akan digunakan.

1570723200000

EndTime

integer

Yes

Akhir rentang pengatur waktu yang akan dikueri. Nilai ini adalah Stempel waktu UNIX dalam milidetik. Jika Anda menentukan TaskId untuk mengambil lebih banyak halaman, parameter ini diabaikan. Waktu akhir dari kueri pertama akan digunakan.

1570809600000

TaskId

string

No

ID tugas kueri. Hilangkan parameter ini untuk kueri pertama. Untuk kueri berikutnya, gunakan ID tugas yang dikembalikan oleh kueri sebelumnya.

0BC1310300002A9F000021E4D7A48346

CurrentPage

integer

Yes

Nomor halaman yang akan dikembalikan. Halaman dimulai dari 1. Nilai dapat mencapai 50 dan tidak boleh melebihi jumlah total halaman.

2

PageSize

integer

No

Jumlah Paket yang akan dikembalikan pada setiap halaman. Nilai default: 20. Nilai minimum: 5. Nilai maksimum: 50. Jika Anda menentukan TaskId untuk mengambil lebih banyak halaman, parameter ini diabaikan. Ukuran halaman dari kueri pertama akan digunakan.

5

InstanceId

string

No

ID instans yang berisi Paket.

MQ_INST_111111111111_DOxxxxxx

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The request ID. Each request has a unique ID. Use this ID to troubleshoot issues.

B00CD3C8-D81E-4A41-85E2-38F19252****

MsgFoundDo

object

The query result.

CurrentPage

integer

The current page number.

1

MsgFoundList

object

OnsRestMessageDo

array<object>

The information about dead-letter messages that are returned on the current page. The information that is contained in this parameter is the same as the information that is returned by the OnsDLQMessageGetById operation.

array<object>

StoreSize

integer

The size of the message. Unit: KB.

406

ReconsumeTimes

integer

The number of retries that were performed to send the message to consumers.

1

StoreTimestamp

integer

The timestamp that indicates the point in time when the ApsaraMQ for RocketMQ broker stored the message.

1570760999811

InstanceId

string

The ID of the instance

MQ_INST_111111111111_DOxxxxxx

MsgId

string

The ID of the message.

1E0578FE110F18B4AAC235C05F2*****

StoreHost

string

The ApsaraMQ for RocketMQ broker that stores the message.

11.193.***.***:10911

Topic

string

The topic to which the message belongs.

test-mq_topic

PropertyList

object

MessageProperty

array<object>

The attributes of the message.

object

Value

string

The value of the attribute.

TagA

Name

string

The name of the attribute. Valid values:

  • TRACE_ON: indicates whether a trace of the message exists.

  • KEYS: indicates the key of the message.

  • TAGS: indicates the tag that is attached to the message.

  • INSTANCE_ID: indicates the ID of the instance that contains the message.

For information about the terms that are used in ApsaraMQ for RocketMQ, see Terms.

TAGS

BornTimestamp

integer

The timestamp that indicates when the message was produced.

1570760999721

BodyCRC

integer

The cyclic redundancy check (CRC) value of the message body.

914112295

BornHost

string

The producer instance that generated the message.

42.120.***.***:59270

MaxPageCount

integer

The total number of pages available.

400

TaskId

string

The ID of the query task. This ID is returned on the first query. Use this ID to retrieve subsequent pages.

0BC1310300002A9F000021E4D7A48346

Contoh

Respons sukses

JSONformat

{
  "RequestId": "B00CD3C8-D81E-4A41-85E2-38F19252****",
  "MsgFoundDo": {
    "CurrentPage": 1,
    "MsgFoundList": {
      "OnsRestMessageDo": [
        {
          "StoreSize": 406,
          "ReconsumeTimes": 1,
          "StoreTimestamp": 1570760999811,
          "InstanceId": "MQ_INST_111111111111_DOxxxxxx",
          "MsgId": "1E0578FE110F18B4AAC235C05F2*****",
          "StoreHost": "11.193.***.***:10911",
          "Topic": "test-mq_topic",
          "PropertyList": {
            "MessageProperty": [
              {
                "Value": "TagA",
                "Name": "TAGS"
              }
            ]
          },
          "BornTimestamp": 1570760999721,
          "BodyCRC": 914112295,
          "BornHost": "42.120.***.***:59270"
        }
      ]
    },
    "MaxPageCount": 400,
    "TaskId": "0BC1310300002A9F000021E4D7A48346"
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.