Skill 寫法圖鑑

azure-messaging

Microsoft | 除錯與調查 | 原文 | MIT

排除 Event Hubs 和 Service Bus SDK 的連線、認證和訊息處理問題

中文翻譯

---
name: azure-messaging
description: "排除 Event Hubs 和 Service Bus 的 Azure Messaging SDK 問題。涵蓋連線失敗、認證錯誤、訊息處理問題和 SDK 設定問題。WHEN: event hub SDK error, service bus SDK issue, messaging connection failure, AMQP error, event processor host issue, message lock lost, message lock expired, lock renewal, lock renewal batch, send timeout, receiver disconnected, SDK troubleshooting, azure messaging SDK, event hub consumer, service bus queue issue, topic subscription error, enable logging event hub, service bus logging, eventhub python, servicebus java, eventhub javascript, servicebus dotnet, event hub checkpoint, event hub not receiving messages, service bus dead letter, batch processing lock, session lock expired, idle timeout, connection inactive, link detach, slow reconnect, session error, duplicate events, offset reset, receive batch."
license: MIT
metadata:
  author: Microsoft
  version: "1.2.1"
---

# Azure Messaging SDK 故障排除

## 快速參考

| 屬性 | 值 |
|----------|-------|
| **服務** | Azure Event Hubs、Azure Service Bus |
| **MCP 工具** | `mcp_azure_mcp_eventhubs`、`mcp_azure_mcp_servicebus` |
| **適用於** | 診斷 SDK 連線、認證和訊息處理問題 |

## 何時使用這個 Skill

- SDK 連線失敗、認證錯誤,或 AMQP link 錯誤
- 閒置逾時、連線不活動,或斷線後重連很慢
- AMQP link detach 或 detach-forced 錯誤
- 訊息鎖遺失、訊息鎖過期、鎖續約失敗,或批次鎖逾時
- Session 鎖遺失、session 鎖過期,或 session receiver 錯誤
- Event processor 或 message handler 停止處理
- 重複事件,或 checkpoint offset 被重設
- SDK 設定問題(retry、prefetch、batch size、receive batch 行為)

## MCP 工具

| 工具 | 指令 | 用途 |
|------|---------|-----|
| `mcp_azure_mcp_eventhubs` | Namespace/hub 操作 | 列出 namespace、hub、consumer group |
| `mcp_azure_mcp_servicebus` | Queue/topic 操作 | 列出 namespace、queue、topic、subscription |
| `mcp_azure_mcp_monitor` | `logs_query` | 用 KQL 查診斷 log |
| `mcp_azure_mcp_resourcehealth` | `get` | 檢查服務健康狀態 |
| `mcp_azure_mcp_documentation` | 文件搜尋 | 到 Microsoft Learn 搜尋故障排除文件 |

## 診斷流程

1. **確認 SDK 和版本**:從 prompt 裡找 SDK 和版本的線索;沒寫的話,先繼續診斷,需要時再問
2. **檢查資源健康狀態**:用 `mcp_azure_mcp_resourcehealth` 確認 namespace 是健康的
3. **檢視錯誤訊息**:對照各語言專屬的故障排除指南
4. **查文件**:用 `mcp_azure_mcp_documentation` 到 Microsoft Learn 搜尋該錯誤或主題
5. **檢查設定**:確認連線字串、entity 名稱、consumer group
6. **建議修正**:套用處理方式,並引用找到的文件


## 故障排除指南

連線、SDK 和認證的故障排除指南放在 azure-diagnostics skill 的 `troubleshooting/messaging/` 底下。

## 參考資料

- 用 `mcp_azure_mcp_documentation` 到 Microsoft Learn 搜尋最新的指引。

英文原文

---
name: azure-messaging
description: "Troubleshoot and resolve issues with Azure Messaging SDKs for Event Hubs and Service Bus. Covers connection failures, authentication errors, message processing issues, and SDK configuration problems. WHEN: event hub SDK error, service bus SDK issue, messaging connection failure, AMQP error, event processor host issue, message lock lost, message lock expired, lock renewal, lock renewal batch, send timeout, receiver disconnected, SDK troubleshooting, azure messaging SDK, event hub consumer, service bus queue issue, topic subscription error, enable logging event hub, service bus logging, eventhub python, servicebus java, eventhub javascript, servicebus dotnet, event hub checkpoint, event hub not receiving messages, service bus dead letter, batch processing lock, session lock expired, idle timeout, connection inactive, link detach, slow reconnect, session error, duplicate events, offset reset, receive batch."
license: MIT
metadata:
  author: Microsoft
  version: "1.2.1"
---

# Azure Messaging SDK Troubleshooting

## Quick Reference

| Property | Value |
|----------|-------|
| **Services** | Azure Event Hubs, Azure Service Bus |
| **MCP Tools** | `mcp_azure_mcp_eventhubs`, `mcp_azure_mcp_servicebus` |
| **Best For** | Diagnosing SDK connection, auth, and message processing issues |

## When to Use This Skill

- SDK connection failures, auth errors, or AMQP link errors
- Idle timeout, connection inactivity, or slow reconnection after disconnect
- AMQP link detach or detach-forced errors
- Message lock lost, message lock expired, lock renewal failures, or batch lock timeouts
- Session lock lost, session lock expired, or session receiver errors
- Event processor or message handler stops processing
- Duplicate events or checkpoint offset resets
- SDK configuration questions (retry, prefetch, batch size, receive batch behavior)

## MCP Tools

| Tool | Command | Use |
|------|---------|-----|
| `mcp_azure_mcp_eventhubs` | Namespace/hub ops | List namespaces, hubs, consumer groups |
| `mcp_azure_mcp_servicebus` | Queue/topic ops | List namespaces, queues, topics, subscriptions |
| `mcp_azure_mcp_monitor` | `logs_query` | Query diagnostic logs with KQL |
| `mcp_azure_mcp_resourcehealth` | `get` | Check service health status |
| `mcp_azure_mcp_documentation` | Doc search | Search Microsoft Learn for troubleshooting docs |

## Diagnosis Workflow

1. **Identify the SDK and version** — Check the prompt for SDK and version clues; if not stated, proceed with diagnosis and ask later if needed
2. **Check resource health** — Use `mcp_azure_mcp_resourcehealth` to verify the namespace is healthy
3. **Review the error message** — Match against language-specific troubleshooting guide
4. **Look up documentation** — Use `mcp_azure_mcp_documentation` to search Microsoft Learn for the error or topic
5. **Check configuration** — Verify connection string, entity name, consumer group
6. **Recommend fix** — Apply remediation, citing documentation found


## Troubleshooting Guides

Connectivity, SDK, and auth troubleshooting guides are located in the azure-diagnostics skill under `troubleshooting/messaging/`.

## References

- Use `mcp_azure_mcp_documentation` to search Microsoft Learn for latest guidance.