Consulta dados de status detalhados de um ID de grupo especificado, incluindo verificações de relação de assinatura, estatísticas de TPS de consumo, status de balanceamento de carga e conexões do lado do consumidor.
Descrição da operação
As OpenAPIs do Alibaba Cloud são APIs de gerenciamento. Elas gerenciam e consultam recursos do Alibaba Cloud. Use-as apenas em fluxos de trabalho de gerenciamento. Não dependa das OpenAPIs em fluxos de trabalho principais de publicação ou consumo de mensagens. Fazer isso pode introduzir riscos.
-
Você pode usar esta operação para solucionar problemas de consumo anormal após confirmar o acúmulo de mensagens ou o status online do cliente. A resposta ajuda a verificar a consistência das relações de assinatura para um ID de grupo especificado, confirmar o balanceamento de carga normal e obter informações do Jstack para clientes online.
-
Esta operação chama muitas interfaces de back-end para agregar dados, o que pode causar execução lenta. Portanto, evite chamadas frequentes.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
mq:QueryConsumerStatus |
get |
Group
Group
|
Nenhuma |
|
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| GroupId |
string |
Sim |
O ID do grupo do consumidor a ser consultado. |
GID_test_group_id |
| Detail |
boolean |
Não |
Especifica se devem ser retornadas informações detalhadas. Valores válidos:
|
true |
| NeedJstack |
boolean |
Não |
Especifica se as informações do Jstack devem ser impressas. Valores válidos:
Nota
Para imprimir as informações do Jstack, defina o parâmetro de solicitação Detail como true.
|
true |
| InstanceId |
string |
Não |
O ID da instância associado ao ID do grupo a ser consultado. |
MQ_INST_111111111111_DOxxxxxx |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
|||
| RequestId |
string |
Um parâmetro comum. Cada solicitação tem um ID exclusivo. Use-o para localizar e solucionar problemas. |
10EDC518-10E7-4B34-92FB-171235FA**** |
| Data |
object |
O resultado da consulta. |
|
| ConsumeTps |
number |
O TPS total de consumo. |
0 |
| ConsumeModel |
string |
O modelo de consumo. Valores válidos:
Para obter mais informações sobre esses modos de assinatura, consulte Consumo de clustering e broadcasting. |
CLUSTERING |
| ConnectionSet |
object |
||
| ConnectionDo |
array<object> |
Information about currently online clients in the cluster. |
|
|
object |
|||
| RemoteIP |
string |
The host IP address or public IP address. |
42.120.74.** |
| Version |
string |
The consumer version. |
V4_3_6_SNAPSHOT |
| ClientAddr |
string |
The address and port of the consumer instance. |
30.5.121.** |
| Language |
string |
The consumer language. |
JAVA |
| ClientId |
string |
The ID of the consumer instance. |
30.5.121.**@25560#-1999745829#-1737591554#458773089270275 |
| Diff |
integer |
100 |
|
| TotalDiff |
integer |
O acúmulo total de mensagens em todo o cluster. |
197 |
| ConsumerConnectionInfoList |
object |
||
| ConsumerConnectionInfoDo |
array<object> |
Detailed information about online clients in the cluster, including Jstack and consumption RT. To get this information, set the Detail request parameter to true. Otherwise, the response is empty. |
|
|
array<object> |
test, this content is not published to ICMS |
||
| ConsumeModel |
string |
The consumption model. Valid values:
For more information about these subscription modes, see Clustering and broadcasting consumption. |
CLUSTERING |
| RunningDataList |
object |
||
| ConsumerRunningDataDo |
array<object> |
Real-time status statistics. |
|
|
object |
|||
| Rt |
number |
Consumption response time (RT), in milliseconds. |
0 |
| Topic |
string |
The name of the subscribed topic. |
test-mq_topic |
| FailedCountPerHour |
integer |
Number of messages that failed to consume per hour. |
0 |
| OkTps |
number |
TPS for successfully consumed messages. |
0 |
| FailedTps |
number |
TPS for messages that failed to consume. |
0 |
| SubscriptionSet |
object |
||
| SubscriptionData |
array<object> |
The collection of subscription relationships. |
|
|
array<object> |
|||
| SubString |
string |
The tag expression used to subscribe to the topic. |
* |
| SubVersion |
integer |
The subscription relationship version number. This is an auto-incrementing long integer. |
1570701364301 |
| Topic |
string |
The name of the subscribed topic. |
test-mq_topic |
| TagsSet |
object |
||
| Tag |
array |
The collection of subscribed tags. |
|
|
string |
The collection of subscribed tags. |
ff |
|
| Jstack |
object |
||
| ThreadTrackDo |
array<object> |
Jstack stack trace. To get Jstack information, set the NeedJstack request parameter to true. Otherwise, the response is empty. |
|
|
array<object> |
test—this content is not published to ICMS |
||
| TrackList |
object |
||
| Track |
array |
The Jstack stack trace string. |
|
|
string |
The Jstack stack trace string. |
TID: 52 STATE: WAITING |
|
| Thread |
string |
The thread name. |
ConsumeMessageThread_0 |
| LastTimeStamp |
integer |
The timestamp of the last consumption. This value uses millisecond-level Unix timestamps. |
1570701368114 |
| StartTimeStamp |
integer |
The timestamp when consumption started. This value uses millisecond-level Unix timestamps. |
1570701361528 |
| Language |
string |
The client language. |
JAVA |
| ClientId |
string |
The ID of the consumer instance. |
30.5.**.**@25560#-1999745829#-1737591554#458773089270275 |
| Connection |
string |
The connection information. |
** |
| Version |
string |
The client version number. |
V4_3_6 |
| ConsumeType |
string |
The message consumption mode. Valid values:
|
PUSH |
| ThreadCount |
integer |
The number of consumption threads. |
20 |
| InstanceId |
string |
O ID da instância. |
MQ_INST_111111111111_DOxxxxxx |
| DetailInTopicList |
object |
||
| DetailInTopicDo |
array<object> |
Consumption details for each topic. To get this information, set the Detail request parameter to true. Otherwise, the response is empty. |
|
|
object |
|||
| DelayTime |
integer |
The consumption delay time for the specified topic, in milliseconds. |
0 |
| TotalDiff |
integer |
The total message accumulation for the topic. |
0 |
| LastTimestamp |
integer |
The timestamp of the last consumption. This value uses millisecond-level Unix timestamps. |
1570701259403 |
| Topic |
string |
The topic name. |
test-mq_topic |
| SubscriptionSame |
boolean |
Indica se as relações de assinatura são consistentes. |
true |
| DelayTime |
integer |
O tempo máximo de atraso de consumo em todos os tópicos assinados pelo ID de grupo especificado, em milissegundos. |
100857 |
| LastTimestamp |
integer |
O timestamp do último consumo. Este valor usa timestamps Unix em milissegundos. |
1566883844954 |
| Online |
boolean |
Indica se o cliente está online. |
true |
| RebalanceOK |
boolean |
Indica se o rebalanceamento está normal. Valores válidos:
|
true |
Exemplos
Resposta de sucesso
JSON formato
{
"RequestId": "10EDC518-10E7-4B34-92FB-171235FA****",
"Data": {
"ConsumeTps": 0,
"ConsumeModel": "CLUSTERING",
"ConnectionSet": {
"ConnectionDo": [
{
"RemoteIP": "42.120.74.**",
"Version": "V4_3_6_SNAPSHOT",
"ClientAddr": "30.5.121.**",
"Language": "JAVA",
"ClientId": "30.5.121.**@25560#-1999745829#-1737591554#458773089270275",
"Diff": 100
}
]
},
"TotalDiff": 197,
"ConsumerConnectionInfoList": {
"ConsumerConnectionInfoDo": [
{
"ConsumeModel": "CLUSTERING",
"RunningDataList": {
"ConsumerRunningDataDo": [
{
"Rt": 0,
"Topic": "test-mq_topic",
"FailedCountPerHour": 0,
"OkTps": 0,
"FailedTps": 0
}
]
},
"SubscriptionSet": {
"SubscriptionData": [
{
"SubString": "*",
"SubVersion": 1570701364301,
"Topic": "test-mq_topic",
"TagsSet": {
"Tag": [
"ff"
]
}
}
]
},
"Jstack": {
"ThreadTrackDo": [
{
"TrackList": {
"Track": [
"TID: 52 STATE: WAITING"
]
},
"Thread": "ConsumeMessageThread_0"
}
]
},
"LastTimeStamp": 1570701368114,
"StartTimeStamp": 1570701361528,
"Language": "JAVA",
"ClientId": "30.5.**.**@25560#-1999745829#-1737591554#458773089270275",
"Connection": "**",
"Version": "V4_3_6",
"ConsumeType": "PUSH",
"ThreadCount": 20
}
]
},
"InstanceId": "MQ_INST_111111111111_DOxxxxxx",
"DetailInTopicList": {
"DetailInTopicDo": [
{
"DelayTime": 0,
"TotalDiff": 0,
"LastTimestamp": 1570701259403,
"Topic": "test-mq_topic"
}
]
},
"SubscriptionSame": true,
"DelayTime": 100857,
"LastTimestamp": 1566883844954,
"Online": true,
"RebalanceOK": true
}
}
Códigos de erro
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.