[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FD2SF5GRPJAC4YTSEXYJTZ":3,"skill-same:01M6FD2SF5GRPJAC4YTSEXYJTZ":47},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M6FD2SF5GRPJAC4YTSEXYJTZ","azure-eventhub-ts",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-eventhub-ts\u002FSKILL.md",[],[18,19],"azure","azure eventhub ts","2026-11-10 10:12:30",false,"# Azure Event Hubs SDK for TypeScript\n\nHigh-throughput event streaming and real-time data ingestion.\n\n## Installation\n\n```bash\nnpm install @azure\u002Fevent-hubs @azure\u002Fidentity\n```\n\nFor checkpointing with consumer groups:\n```bash\nnpm install @azure\u002Feventhubs-checkpointstore-blob @azure\u002Fstorage-blob\n```\n\n## Environment Variables\n\n```bash\nEVENTHUB_NAMESPACE=\u003Cnamespace>.servicebus.windows.net\nEVENTHUB_NAME=my-eventhub\nSTORAGE_ACCOUNT_NAME=\u003Cstorage-account>\nSTORAGE_CONTAINER_NAME=checkpoints\n```\n\n## Authentication\n\n```typescript\nimport { EventHubProducerClient, EventHubConsumerClient } from \"@azure\u002Fevent-hubs\";\nimport { DefaultAzureCredential } from \"@azure\u002Fidentity\";\n\nconst fullyQualifiedNamespace = process.env.EVENTHUB_NAMESPACE!;\nconst eventHubName = process.env.EVENTHUB_NAME!;\nconst credential = new DefaultAzureCredential();\n\n\u002F\u002F Producer\nconst producer = new EventHubProducerClient(fullyQualifiedNamespace, eventHubName, credential);\n\n\u002F\u002F Consumer\nconst consumer = new EventHubConsumerClient(\n  \"$Default\", \u002F\u002F Consumer group\n  fullyQualifiedNamespace,\n  eventHubName,\n  credential\n);\n```\n\n## Core Workflow\n\n### Send Events\n\n```typescript\nconst producer = new EventHubProducerClient(namespace, eventHubName, credential);\n\n\u002F\u002F Create batch and add events\nconst batch = await producer.createBatch();\nbatch.tryAdd({ body: { temperature: 72.5, deviceId: \"sensor-1\" } });\nbatch.tryAdd({ body: { temperature: 68.2, deviceId: \"sensor-2\" } });\n\nawait producer.sendBatch(batch);\nawait producer.close();\n```\n\n### Send to Specific Partition\n\n```typescript\n\u002F\u002F By partition ID\nconst batch = await producer.createBatch({ partitionId: \"0\" });\n\n\u002F\u002F By partition key (consistent hashing)\nconst batch = await producer.createBatch({ partitionKey: \"device-123\" });\n```\n\n### Receive Events (Simple)\n\n```typescript\nconst consumer = new EventHubConsumerClient(\"$Default\", namespace, eventHubName, credential);\n\nconst subscription = consumer.subscribe({\n  processEvents: async (events, context) => {\n    for (const event of events) {\n      console.log(`Partition: ${context.partitionId}, Body: ${JSON.stringify(event.body)}`);\n    }\n  },\n  processError: async (err, context) => {\n    console.error(`Error on partition ${context.partitionId}: ${err.message}`);\n  },\n});\n\n\u002F\u002F Stop after some time\nsetTimeout(async () => {\n  await subscription.close();\n  await consumer.close();\n}, 60000);\n```\n\n### Receive with Checkpointing (Production)\n\n```typescript\nimport { EventHubConsumerClient } from \"@azure\u002Fevent-hubs\";\nimport { ContainerClient } from \"@azure\u002Fstorage-blob\";\nimport { BlobCheckpointStore } from \"@azure\u002Feventhubs-checkpointstore-blob\";\n\nconst containerClient = new ContainerClient(\n  `https:\u002F\u002F${storageAccount}.blob.core.windows.net\u002F${containerName}`,\n  credential\n);\n\nconst checkpointStore = new BlobCheckpointStore(containerClient);\n\nconst consumer = new EventHubConsumerClient(\n  \"$Default\",\n  namespace,\n  eventHubName,\n  credential,\n  checkpointStore\n);\n\nconst subscription = consumer.subscribe({\n  processEvents: async (events, context) => {\n    for (const event of events) {\n      console.log(`Processing: ${JSON.stringify(event.body)}`);\n    }\n    \u002F\u002F Checkpoint after processing batch\n    if (events.length > 0) {\n      await context.updateCheckpoint(events[events.length - 1]);\n    }\n  },\n  processError: async (err, context) => {\n    console.error(`Error: ${err.message}`);\n  },\n});\n```\n\n### Receive from Specific Position\n\n```typescript\nconst subscription = consumer.subscribe({\n  processEvents: async (events, context) => { \u002F* ... *\u002F },\n  processError: async (err, context) => { \u002F* ... *\u002F },\n}, {\n  startPosition: {\n    \u002F\u002F Start from beginning\n    \"0\": { offset: \"@earliest\" },\n    \u002F\u002F Start from end (new events only)\n    \"1\": { offset: \"@latest\" },\n    \u002F\u002F Start from specific offset\n    \"2\": { offset: \"12345\" },\n    \u002F\u002F Start from specific time\n    \"3\": { enqueuedOn: new Date(\"2024-01-01\") },\n  },\n});\n```\n\n## Event Hub Properties\n\n```typescript\n\u002F\u002F Get hub info\nconst hubProperties = await producer.getEventHubProperties();\nconsole.log(`Partitions: ${hubProperties.partitionIds}`);\n\n\u002F\u002F Get partition info\nconst partitionProperties = await producer.getPartitionProperties(\"0\");\nconsole.log(`Last sequence: ${partitionProperties.lastEnqueuedSequenceNumber}`);\n```\n\n## Batch Processing Options\n\n```typescript\nconst subscription = consumer.subscribe(\n  {\n    processEvents: async (events, context) => { \u002F* ... *\u002F },\n    processError: async (err, context) => { \u002F* ... *\u002F },\n  },\n  {\n    maxBatchSize: 100,           \u002F\u002F Max events per batch\n    maxWaitTimeInSeconds: 30,    \u002F\u002F Max wait for batch\n  }\n);\n```\n\n## Key Types\n\n```typescript\nimport {\n  EventHubProducerClient,\n  EventHubConsumerClient,\n  EventData,\n  ReceivedEventData,\n  PartitionContext,\n  Subscription,\n  SubscriptionEventHandlers,\n  CreateBatchOptions,\n  EventPosition,\n} from \"@azure\u002Fevent-hubs\";\n\nimport { BlobCheckpointStore } from \"@azure\u002Feventhubs-checkpointstore-blob\";\n```\n\n## Event Properties\n\n```typescript\n\u002F\u002F Send with properties\nconst batch = await producer.createBatch();\nbatch.tryAdd({\n  body: { data: \"payload\" },\n  properties: {\n    eventType: \"telemetry\",\n    deviceId: \"sensor-1\",\n  },\n  contentType: \"application\u002Fjson\",\n  correlationId: \"request-123\",\n});\n\n\u002F\u002F Access in receiver\nconsumer.subscribe({\n  processEvents: async (events, context) => {\n    for (const event of events) {\n      console.log(`Type: ${event.properties?.eventType}`);\n      console.log(`Sequence: ${event.sequenceNumber}`);\n      console.log(`Enqueued: ${event.enqueuedTimeUtc}`);\n      console.log(`Offset: ${event.offset}`);\n    }\n  },\n});\n```\n\n## Error Handling\n\n```typescript\nconsumer.subscribe({\n  processEvents: async (events, context) => {\n    try {\n      for (const event of events) {\n        await processEvent(event);\n      }\n      await context.updateCheckpoint(events[events.length - 1]);\n    } catch (error) {\n      \u002F\u002F Don't checkpoint on error - events will be reprocessed\n      console.error(\"Processing failed:\", error);\n    }\n  },\n  processError: async (err, context) => {\n    if (err.name === \"MessagingError\") {\n      \u002F\u002F Transient error - SDK will retry\n      console.warn(\"Transient error:\", err.message);\n    } else {\n      \u002F\u002F Fatal error\n      console.error(\"Fatal error:\", err);\n    }\n  },\n});\n```\n\n## Best Practices\n\n1. **Use checkpointing** - Always checkpoint in production for exactly-once processing\n2. **Batch sends** - Use `createBatch()` for efficient sending\n3. **Partition keys** - Use partition keys to ensure ordering for related events\n4. **Consumer groups** - Use separate consumer groups for different processing pipelines\n5. **Handle errors gracefully** - Don't checkpoint on processing failures\n6. **Close clients** - Always close producer\u002Fconsumer when done\n7. **Monitor lag** - Track `lastEnqueuedSequenceNumber` vs processed sequence\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmicrosoft\u002Fskills\u002Fazure-eventhub-ts",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-ts",{"tool":39,"command":40},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-ts",{"tool":42,"command":43},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-ts","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-eventhub-ts\u002FSKILL.md",true,[],[48,62,72,81,87,94],{"skillNo":49,"name":50,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":58,"publishedAt":20},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[53],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[59,60,61],"model","model hierarchy","model hierarchy skill",{"skillNo":63,"name":64,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":68,"publishedAt":20},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[67],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},[69,70,71],"MCP","zoom","zoom mcp",{"skillNo":73,"name":74,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":20},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[78,79,80,70],"sdk","zoom apps sdk","apps",{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":20},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[83],{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":93,"publishedAt":20},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[92],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},[89],{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[96]]