Tüm Ürünler
Search
Belge Merkezi

:OnsTraceGetResult

Son Güncelleme:Sep 30, 2026

Görev kimliğini kullanarak bir mesaj izi sorgulama görevinin sonuçlarını getirir.

Operation description

Önemli

Alibaba Cloud OpenAPI bir yönetim API'sidir. Alibaba Cloud hizmetlerine yönelik kaynakları yönetmek ve sorgulamak için kullanın. Bu API'yi yalnızca yönetim amaçları için entegre edin. Mesaj gönderme ve alma için kullanılan temel veri bağlantısında bu API'yi kullanmayın, çünkü bu durum veri bağlantınız için tehdit oluşturabilir.

  • OnsTraceQueryByMsgId veya OnsTraceQueryByMsgKey işlemini çağırarak bir mesaj izi sorgulama görevi oluşturduktan sonra bir görev kimliği alırsınız. Ardından mesaj izinin ayrıntılarını almak için bu işlemi çağırabilirsiniz. Görev kimliği, oluşturma işlemi tarafından döndürülen QueryId değeridir.

  • Mesaj izi sorgulama görevleri zaman alıcıdır. Bir görev oluşturduktan hemen sonra bu işlemi çağırırsanız sorgu boş bir sonuç döndürebilir. Bu durum gerçekleşirse kısa bir süre bekleyin ve ardından çağrıyı yeniden deneyin.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

mq:GetTraceResult

get

*Topic

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

*Topic

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

None
  • mq:QueryInstanceBaseInfo

Request parameters

Parameter

Type

Required

Description

Example

QueryId

string

Yes

Mesaj izi sorgulama sonuçlarının getirileceği görevin kimliği.

272967562652883649157096685****

InstanceId

string

No

Sorgulamak istediğiniz mesajı içeren örneğin kimliği.

MQ_INST_111111111111_DOxxxxxx

Topic

string

No

Sorgulamak istediğiniz mesajın konusu.

test

Response elements

Element

Type

Description

Example

object

RequestId

string

İsteğin kimliği. Bu ortak bir parametredir. Her isteğin, sorunları gidermek için kullanabileceğiniz benzersiz bir kimliği vardır.

84EE24D2-851F-40D6-B99E-4D6AB909****

TraceData

object

Sorgu görevi sonuçlarının ayrıntıları.

Status

string

Sorgu görevinin sonucu. Geçerli değerler:

  • finish: Sorgu tamamlandı.

  • working: Sorgu devam ediyor.

  • removed: Görev silindi.

finish

MsgKey

string

Sorgu görevine karşılık gelen mesaj anahtarı.

ORDERID_100

UpdateTime

integer

Sorgu görevinin son güncelleme zamanı.

1570966877000

CreateTime

integer

Sorgu görevinin oluşturma zamanı.

1570966857000

Topic

string

Sorgu görevinin konusu.

test

UserId

string

Sorguyu başlatan kullanıcının kimliği.

27296756265288****

InstanceId

string

Örnek kimliği.

MQ_INST_111111111111_DOxxxxxx

MsgId

string

Sorgu görevine karşılık gelen mesaj kimliği.

1E05791C117818B4AAC23B1BB0CE****

TraceList

object

TraceMapDo

array<object>

Sorgu görevi için eşleşen mesaj izlerinin listesi.

array<object>

Status

string

Gönderim durumu. Geçerli değerler:

  • SEND_SUCCESS: Mesaj başarıyla gönderildi.

  • SEND_FAILED: Mesaj gönderilemedi.

  • SEND_ROLLBACK: İşlemsel mesaj geri alındı.

  • SEND_UNKNOWN: İşlemsel mesaj onaylanmadı.

  • SEND_DELAY: Zamanlanmış veya gecikmeli mesaj gönderilmeyi bekliyor.

SEND_SUCCESS

MsgKey

string

Mesaj anahtarı.

ORDERID_100

PubTime

integer

Mesajın gönderildiği zaman.

1570850870478

SubList

object

SubMapDo

array<object>

Mesaja ait tüketim izlerinin listesi.

array<object>

ClientList

object

SubClientInfoDo

array<object>

Grup kimliğine ait olan istemci için tüketim kayıtlarının listesi.

object

Status

string

The consumption status. Valid values:

  • CONSUME_FAILED: The message failed to be consumed.

  • CONSUME_SUCCESS: The message was consumed successfully.

  • CONSUME_NOT_RETURN: The consumption result was not returned.

  • SEND_UNKNOWN: The transactional message was not committed.

  • SEND_DELAY: The scheduled or delayed message is waiting to be sent.

CONSUME_SUCCESS

SubTime

integer

The UNIX timestamp for when the consumption started.

1570851590511

ReconsumeTimes

integer

The number of delivery attempts for this consumption.

1

SubGroupName

string

The group ID to which the client belongs.

GID_test

ClientHost

string

The address of the consumer client.

30.5.**.**

CostTime

integer

The time taken for this consumption, in milliseconds.

43

FailCount

integer

Grup kimliği için başarısız tüketim sayısı.

0

SubGroupName

string

Tüketicinin grup kimliği.

GID_test

SuccessCount

integer

Grup kimliği için başarılı tüketim sayısı.

1

Topic

string

Mesajın konusu.

test

CostTime

integer

Mesajı göndermek için harcanan süre (milisaniye cinsinden).

24

Tag

string

Mesaj etiketi.

TagA

MsgId

string

Mesaj kimliği.

0BC1F01800002A9F000000531246****

PubGroupName

string

Üretici istemcide yapılandırılan grup kimliği.

GID_test

BornHost

string

Üretici istemcinin adresi.

30.5.**.**

QueryId

string

Sorgu görevinin kimliği.

272967562652883649157096685****

Examples

Success response

JSON format

{
  "RequestId": "84EE24D2-851F-40D6-B99E-4D6AB909****",
  "TraceData": {
    "Status": "finish",
    "MsgKey": "ORDERID_100",
    "UpdateTime": 1570966877000,
    "CreateTime": 1570966857000,
    "Topic": "test",
    "UserId": "27296756265288****",
    "InstanceId": "MQ_INST_111111111111_DOxxxxxx",
    "MsgId": "1E05791C117818B4AAC23B1BB0CE****",
    "TraceList": {
      "TraceMapDo": [
        {
          "Status": "SEND_SUCCESS",
          "MsgKey": "ORDERID_100",
          "PubTime": 1570850870478,
          "SubList": {
            "SubMapDo": [
              {
                "ClientList": {
                  "SubClientInfoDo": [
                    {
                      "Status": "CONSUME_SUCCESS",
                      "SubTime": 1570851590511,
                      "ReconsumeTimes": 1,
                      "SubGroupName": "GID_test",
                      "ClientHost": "30.5.**.**",
                      "CostTime": 43
                    }
                  ]
                },
                "FailCount": 0,
                "SubGroupName": "GID_test",
                "SuccessCount": 1
              }
            ]
          },
          "Topic": "test",
          "CostTime": 24,
          "Tag": "TagA",
          "MsgId": "0BC1F01800002A9F000000531246****",
          "PubGroupName": "GID_test",
          "BornHost": "30.5.**.**"
        }
      ]
    },
    "QueryId": "272967562652883649157096685****"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.