All Products
Search
Document Center

OnsTraceGetResult

Last Updated: Apr 01, 2019

OnsTraceGetResult

You can call this operation to query the task ID through the input trace to obtain previous trace query results.

Description

This operation is used when the service provider has created the trace query task by message ID or message key and obtained the ID of the query task. You can call the operation to obtain detailed trace query results based on the task ID.

As a message trace query task is time-consuming, the result may be empty if you obtain it by calling this operation immediately after creating the task. We recommend that you wait before trying it again.

Request parameters

Name Type Required Description
PreventCache Long Yes The parameter used for CSRF verification, which can be set to the current system time. Unit: ms
QueryId String Yes The ID of the task for which trace query results need to be extracted.

Response parameters

Name Type Description
RequestId String A common parameter. Each request has a unique ID.
HelpUrl String A help link.
TraceData TraceData The detailed results of the query task.

Fields in TraceData

Name Type Description
queryId String The ID of the query task.
userId String The ID of the query user.
topic String The topic corresponding to the query task.
msgId String The message ID corresponding to the query task.
msgKey String The message key corresponding to the query task.
status String The status of the query task. Valid values:
  • finish: The query task is completed.
  • working: The query task is running.
  • removed: The query task has been removed.
createTime Long The time when the query task was created.
updateTime Long The time when the query task was last updated.
traceList List(TraceMapDo) A list of matching traces for the query task.

Fields in TraceMapDo

Name Type Description
pubTime Long The time when the message was sent.
topic String The topic of the message.
pubGroupName String The group ID configured on the sender.
msgId String The message ID.
tag String The message tag.
msgKey String The message key.
bornHost String The address of the message sender.
costTime Integer The sending duration. Unit: ms.
status String The sending status. Valid values:
  • SEND_SUCCESS: The message was sent successfully.
  • SEND_FAILED: The message failed to be sent.
  • SEND_ROLLBACK: A transactional message was rolled back.
  • SEND_UNKNOWN: A transactional message was not committed.
  • SEND_DELAY: A scheduled or delay message is in the standing by state.
subList List(SubMapDo) A list of message consumption traces.

Fields in SubMapDo

Name Type Description
subGroupName String The group ID of the consumer.
successCount Integer The count of successful consumptions corresponding to the group ID.
failCount Integer The number of consumption failures corresponding to the group ID.
clientList List(SubClientInfoDo) Detailed consumption records corresponding to the group ID.

Fields in SubClientInfoDo

Name Type Description
subGroupName String The group ID of the client.
subTime Long The start timestamp of consumption.
clientHost String The address of the consumer.
reconsumeTimes Integer The message delivery round for this consumption.
costTime Integer The consumption duration. Unit: ms.
status String The consumption status. Valid values:
  • CONSUME_FAILED: Consumption failed.
  • CONSUME_SUCCESS: Consumption succeeded.
  • CONSUME_NOT_RETURN: Consumption result was not returned.
  • SEND_UNKNOWN: A transactional message was not committed.
  • SEND_DELAY: A scheduled or delayed message is in the standing by state.

Examples

For more information about sample codes, see API sample code and endpoints.