調用DescribeConsumerChannel介面查詢DTS訂閱任務的消費組資訊,如消費組ID、名稱和帳號,消費延遲時間等。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
請求參數
| 名稱 | 類型 | 是否必選 | 樣本值 | 描述 |
| Action | String | 是 | DescribeConsumerChannel | 系統規定參數。取值:DescribeConsumerChannel。 |
| RegionId | String | 是 | cn-hangzhou | DTS訂閱執行個體所在地區的ID,請參見支援的地區列表。 |
| DtsInstanceId | String | 否 | dtsboss6pn1w****** | 訂閱執行個體ID,可以調用DescribeDtsJobs查詢。 說明 參數DtsInstanceId與DtsJobId,兩者必須傳入其一。 |
| DtsJobId | String | 否 | boss6pn1w****** | 訂閱任務ID,可以調用DescribeDtsJobs查詢。 說明 參數DtsInstanceId與DtsJobId,兩者必須傳入其一。 |
| PageSize | Integer | 否 | 20 | 每頁記錄數,取值範圍為1~100,預設值為20。 |
| PageNumber | Integer | 否 | 1 | 頁碼,取值為大於0且不超過Integer資料類型的最大值,預設值為1。 |
| ParentChannelId | String | 否 | dtsan5114c52****** | 分布式任務的父任務ChannelId。 |
返回資料
| 名稱 | 類型 | 樣本值 | 描述 |
| HttpStatusCode | String | 200 | 狀態代碼。 |
| RequestId | String | D66140B3-C747-42B6-8315-BAF6490E**** | 請求ID。 |
| ErrCode | String | InternalError | 調用出錯時返回的錯誤碼。 |
| PageRecordCount | Integer | 20 | 一頁最多可展示的消費組數量。 |
| Success | String | true | 請求是否成功。 |
| TotalRecordCount | Long | 1 | 消費組總數。 |
| ErrMessage | String | The request processing has failed due to some unknown error. | 調用出錯時返回對應的錯誤資訊。 |
| PageNumber | Integer | 1 | 頁碼。 |
| ConsumerChannels | Array of ConsumerChannel | 消費組列表。 |
|
| ConsumerGroupUserName | String | dtstest | 消費組的帳號。 |
| ConsumerGroupId | String | dtsor2y66j4219**** | 消費組ID。 |
| MessageDelay | Long | 1500 | 訊息延遲時間,該時間=下遊用戶端最新消費資料的時間戳記-資料訂閱任務中最新訂閱資料的時間戳記,格式為Unix時間戳記,單位為秒。 例如,源庫最新的資料於10點產生,目前DTS訂閱任務已讀取到源庫9點55分的資料,下遊用戶端消費到9點30分的資料,此時訊息延遲時間應為9點55分至9點30分的unix時間戳記差值。 說明 如果該參數返回-1,則表示當前沒有用戶端串連該消費組。 |
| ConsumerGroupName | String | 訂閱組A | 消費組的名稱。 |
| ConsumptionCheckpoint | String | 2021-06-20T12:00:00Z | 消費位點,即用戶端在訂閱通道內消費最後一條資訊的時間點,格式為yyyy-MM-ddTHH:mm:ssZ(UTC時間)。 |
| UnconsumedData | Long | 186600 | 未消費的訊息總數,為未消費的訂閱資料數量與心跳訊息數量的和。 說明 如果該參數返回-1,則表示當前沒有用戶端串連該消費組。 |
樣本
請求樣本
http(s)://dts.aliyuncs.com/?Action=DescribeConsumerChannel
&RegionId=cn-hangzhou
&DtsInstanceId=dtsboss6pn1w******
正常返回樣本
XML格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeConsumerChannelResponse>
<TotalRecordCount>1</TotalRecordCount>
<PageRecordCount>20</PageRecordCount>
<RequestId>D66140B3-C747-42B6-8315-BAF6490E****</RequestId>
<PageNumber>1</PageNumber>
<HttpStatusCode>200</HttpStatusCode>
<ConsumerChannels>
<ConsumptionCheckpoint/>
<ConsumerGroupId>dtsor2y66j4219****</ConsumerGroupId>
<ConsumerGroupUserName>dtstest</ConsumerGroupUserName>
<ConsumerGroupName>訂閱組A</ConsumerGroupName>
<MessageDelay>-1</MessageDelay>
<UnconsumedData>-1</UnconsumedData>
</ConsumerChannels>
<Success>true</Success>
</DescribeConsumerChannelResponse>
JSON格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalRecordCount" : 1,
"PageRecordCount" : 20,
"RequestId" : "D66140B3-C747-42B6-8315-BAF6490E****",
"PageNumber" : 1,
"HttpStatusCode" : 200,
"ConsumerChannels" : [ {
"ConsumptionCheckpoint" : "",
"ConsumerGroupId" : "dtsor2y66j4219****",
"ConsumerGroupUserName" : "dtstest",
"ConsumerGroupName" : "訂閱組A",
"MessageDelay" : -1,
"UnconsumedData" : -1
} ],
"Success" : true
}
錯誤碼
| HttpCode | 錯誤碼 | 錯誤資訊 | 描述 |
| 400 | Throttling.User | Request was denied due to user flow control. | 由於請求頻次達到閾值,請求被拒絕,請稍後重試。 |
| 500 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 由於服務端響應逾時或者不可用導致請求失敗,請重試,重試後仍失敗請聯絡支援人員。 |
| 403 | InvalidSecurityToken.Expired | Specified SecurityToken is expired. | 簽名已經到期,請更新簽名 |
訪問錯誤中心查看更多錯誤碼。