[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FD2F14J6T2B22RMFDTTQ8Q":3,"skill-same:01M6FD2F14J6T2B22RMFDTTQ8Q":48},{"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":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M6FD2F14J6T2B22RMFDTTQ8Q","azure-eventhub-java",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-java\u002FSKILL.md",[],[18,19,20],"azure","azure eventhub java","java","2026-11-10 10:12:30",false,"# Azure Event Hubs SDK for Java\n\nBuild real-time streaming applications using the Azure Event Hubs SDK for Java.\n\n## Installation\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>com.azure\u003C\u002FgroupId>\n    \u003CartifactId>azure-messaging-eventhubs\u003C\u002FartifactId>\n    \u003Cversion>5.19.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n\n\u003C!-- For checkpoint store (production) -->\n\u003Cdependency>\n    \u003CgroupId>com.azure\u003C\u002FgroupId>\n    \u003CartifactId>azure-messaging-eventhubs-checkpointstore-blob\u003C\u002FartifactId>\n    \u003Cversion>1.20.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n## Client Creation\n\n### EventHubProducerClient\n\n```java\nimport com.azure.messaging.eventhubs.EventHubProducerClient;\nimport com.azure.messaging.eventhubs.EventHubClientBuilder;\n\n\u002F\u002F With connection string\nEventHubProducerClient producer = new EventHubClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\", \"\u003Cevent-hub-name>\")\n    .buildProducerClient();\n\n\u002F\u002F Full connection string with EntityPath\nEventHubProducerClient producer = new EventHubClientBuilder()\n    .connectionString(\"\u003Cconnection-string-with-entity-path>\")\n    .buildProducerClient();\n```\n\n### With DefaultAzureCredential\n\n```java\nimport com.azure.identity.DefaultAzureCredentialBuilder;\n\nEventHubProducerClient producer = new EventHubClientBuilder()\n    .fullyQualifiedNamespace(\"\u003Cnamespace>.servicebus.windows.net\")\n    .eventHubName(\"\u003Cevent-hub-name>\")\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildProducerClient();\n```\n\n### EventHubConsumerClient\n\n```java\nimport com.azure.messaging.eventhubs.EventHubConsumerClient;\n\nEventHubConsumerClient consumer = new EventHubClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\", \"\u003Cevent-hub-name>\")\n    .consumerGroup(EventHubClientBuilder.DEFAULT_CONSUMER_GROUP_NAME)\n    .buildConsumerClient();\n```\n\n### Async Clients\n\n```java\nimport com.azure.messaging.eventhubs.EventHubProducerAsyncClient;\nimport com.azure.messaging.eventhubs.EventHubConsumerAsyncClient;\n\nEventHubProducerAsyncClient asyncProducer = new EventHubClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\", \"\u003Cevent-hub-name>\")\n    .buildAsyncProducerClient();\n\nEventHubConsumerAsyncClient asyncConsumer = new EventHubClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\", \"\u003Cevent-hub-name>\")\n    .consumerGroup(\"$Default\")\n    .buildAsyncConsumerClient();\n```\n\n## Core Patterns\n\n### Send Single Event\n\n```java\nimport com.azure.messaging.eventhubs.EventData;\n\nEventData eventData = new EventData(\"Hello, Event Hubs!\");\nproducer.send(Collections.singletonList(eventData));\n```\n\n### Send Event Batch\n\n```java\nimport com.azure.messaging.eventhubs.EventDataBatch;\nimport com.azure.messaging.eventhubs.models.CreateBatchOptions;\n\n\u002F\u002F Create batch\nEventDataBatch batch = producer.createBatch();\n\n\u002F\u002F Add events (returns false if batch is full)\nfor (int i = 0; i \u003C 100; i++) {\n    EventData event = new EventData(\"Event \" + i);\n    if (!batch.tryAdd(event)) {\n        \u002F\u002F Batch is full, send and create new batch\n        producer.send(batch);\n        batch = producer.createBatch();\n        batch.tryAdd(event);\n    }\n}\n\n\u002F\u002F Send remaining events\nif (batch.getCount() > 0) {\n    producer.send(batch);\n}\n```\n\n### Send to Specific Partition\n\n```java\nCreateBatchOptions options = new CreateBatchOptions()\n    .setPartitionId(\"0\");\n\nEventDataBatch batch = producer.createBatch(options);\nbatch.tryAdd(new EventData(\"Partition 0 event\"));\nproducer.send(batch);\n```\n\n### Send with Partition Key\n\n```java\nCreateBatchOptions options = new CreateBatchOptions()\n    .setPartitionKey(\"customer-123\");\n\nEventDataBatch batch = producer.createBatch(options);\nbatch.tryAdd(new EventData(\"Customer event\"));\nproducer.send(batch);\n```\n\n### Event with Properties\n\n```java\nEventData event = new EventData(\"Order created\");\nevent.getProperties().put(\"orderId\", \"ORD-123\");\nevent.getProperties().put(\"customerId\", \"CUST-456\");\nevent.getProperties().put(\"priority\", 1);\n\nproducer.send(Collections.singletonList(event));\n```\n\n### Receive Events (Simple)\n\n```java\nimport com.azure.messaging.eventhubs.models.EventPosition;\nimport com.azure.messaging.eventhubs.models.PartitionEvent;\n\n\u002F\u002F Receive from specific partition\nIterable\u003CPartitionEvent> events = consumer.receiveFromPartition(\n    \"0\",                           \u002F\u002F partitionId\n    10,                            \u002F\u002F maxEvents\n    EventPosition.earliest(),      \u002F\u002F startingPosition\n    Duration.ofSeconds(30)         \u002F\u002F timeout\n);\n\nfor (PartitionEvent partitionEvent : events) {\n    EventData event = partitionEvent.getData();\n    System.out.println(\"Body: \" + event.getBodyAsString());\n    System.out.println(\"Sequence: \" + event.getSequenceNumber());\n    System.out.println(\"Offset: \" + event.getOffset());\n}\n```\n\n### EventProcessorClient (Production)\n\n```java\nimport com.azure.messaging.eventhubs.EventProcessorClient;\nimport com.azure.messaging.eventhubs.EventProcessorClientBuilder;\nimport com.azure.messaging.eventhubs.checkpointstore.blob.BlobCheckpointStore;\nimport com.azure.storage.blob.BlobContainerAsyncClient;\nimport com.azure.storage.blob.BlobContainerClientBuilder;\n\n\u002F\u002F Create checkpoint store\nBlobContainerAsyncClient blobClient = new BlobContainerClientBuilder()\n    .connectionString(\"\u003Cstorage-connection-string>\")\n    .containerName(\"checkpoints\")\n    .buildAsyncClient();\n\n\u002F\u002F Create processor\nEventProcessorClient processor = new EventProcessorClientBuilder()\n    .connectionString(\"\u003Ceventhub-connection-string>\", \"\u003Cevent-hub-name>\")\n    .consumerGroup(\"$Default\")\n    .checkpointStore(new BlobCheckpointStore(blobClient))\n    .processEvent(eventContext -> {\n        EventData event = eventContext.getEventData();\n        System.out.println(\"Processing: \" + event.getBodyAsString());\n        \n        \u002F\u002F Checkpoint after processing\n        eventContext.updateCheckpoint();\n    })\n    .processError(errorContext -> {\n        System.err.println(\"Error: \" + errorContext.getThrowable().getMessage());\n        System.err.println(\"Partition: \" + errorContext.getPartitionContext().getPartitionId());\n    })\n    .buildEventProcessorClient();\n\n\u002F\u002F Start processing\nprocessor.start();\n\n\u002F\u002F Keep running...\nThread.sleep(Duration.ofMinutes(5).toMillis());\n\n\u002F\u002F Stop gracefully\nprocessor.stop();\n```\n\n### Batch Processing\n\n```java\nEventProcessorClient processor = new EventProcessorClientBuilder()\n    .connectionString(\"\u003Cconnection-string>\", \"\u003Cevent-hub-name>\")\n    .consumerGroup(\"$Default\")\n    .checkpointStore(new BlobCheckpointStore(blobClient))\n    .processEventBatch(eventBatchContext -> {\n        List\u003CEventData> events = eventBatchContext.getEvents();\n        System.out.printf(\"Received %d events%n\", events.size());\n        \n        for (EventData event : events) {\n            \u002F\u002F Process each event\n            System.out.println(event.getBodyAsString());\n        }\n        \n        \u002F\u002F Checkpoint after batch\n        eventBatchContext.updateCheckpoint();\n    }, 50) \u002F\u002F maxBatchSize\n    .processError(errorContext -> {\n        System.err.println(\"Error: \" + errorContext.getThrowable());\n    })\n    .buildEventProcessorClient();\n```\n\n### Async Receiving\n\n```java\nasyncConsumer.receiveFromPartition(\"0\", EventPosition.latest())\n    .subscribe(\n        partitionEvent -> {\n            EventData event = partitionEvent.getData();\n            System.out.println(\"Received: \" + event.getBodyAsString());\n        },\n        error -> System.err.println(\"Error: \" + error),\n        () -> System.out.println(\"Complete\")\n    );\n```\n\n### Get Event Hub Properties\n\n```java\n\u002F\u002F Get hub info\nEventHubProperties hubProps = producer.getEventHubProperties();\nSystem.out.println(\"Hub: \" + hubProps.getName());\nSystem.out.println(\"Partitions: \" + hubProps.getPartitionIds());\n\n\u002F\u002F Get partition info\nPartitionProperties partitionProps = producer.getPartitionProperties(\"0\");\nSystem.out.println(\"Begin sequence: \" + partitionProps.getBeginningSequenceNumber());\nSystem.out.println(\"Last sequence: \" + partitionProps.getLastEnqueuedSequenceNumber());\nSystem.out.println(\"Last offset: \" + partitionProps.getLastEnqueuedOffset());\n```\n\n## Event Positions\n\n```java\n\u002F\u002F Start from beginning\nEventPosition.earliest()\n\n\u002F\u002F Start from end (new events only)\nEventPosition.latest()\n\n\u002F\u002F From specific offset\nEventPosition.fromOffset(12345L)\n\n\u002F\u002F From specific sequence number\nEventPosition.fromSequenceNumber(100L)\n\n\u002F\u002F From specific time\nEventPosition.fromEnqueuedTime(Instant.now().minus(Duration.ofHours(1)))\n```\n\n## Error Handling\n\n```java\nimport com.azure.messaging.eventhubs.models.ErrorContext;\n\n.processError(errorContext -> {\n    Throwable error = errorContext.getThrowable();\n    String partitionId = errorContext.getPartitionContext().getPartitionId();\n    \n    if (error instanceof AmqpException) {\n        AmqpException amqpError = (AmqpException) error;\n        if (amqpError.isTransient()) {\n            System.out.println(\"Transient error, will retry\");\n        }\n    }\n    \n    System.err.printf(\"Error on partition %s: %s%n\", partitionId, error.getMessage());\n})\n```\n\n## Resource Cleanup\n\n```java\n\u002F\u002F Always close clients\ntry {\n    producer.send(batch);\n} finally {\n    producer.close();\n}\n\n\u002F\u002F Or use try-with-resources\ntry (EventHubProducerClient producer = new EventHubClientBuilder()\n        .connectionString(connectionString, eventHubName)\n        .buildProducerClient()) {\n    producer.send(events);\n}\n```\n\n## Environment Variables\n\n```bash\nEVENT_HUBS_CONNECTION_STRING=Endpoint=sb:\u002F\u002F\u003Cnamespace>.servicebus.windows.net\u002F;SharedAccessKeyName=...\nEVENT_HUBS_NAME=\u003Cevent-hub-name>\nSTORAGE_CONNECTION_STRING=\u003Cfor-checkpointing>\n```\n\n## Best Practices\n\n1. **Use EventProcessorClient**: For production, provides load balancing and checkpointing\n2. **Batch Events**: Use `EventDataBatch` for efficient sending\n3. **Partition Keys**: Use for ordering guarantees within a partition\n4. **Checkpointing**: Checkpoint after processing to avoid reprocessing\n5. **Error Handling**: Handle transient errors with retries\n6. **Close Clients**: Always close producer\u002Fconsumer when done\n\n## Trigger Phrases\n\n- \"Event Hubs Java\"\n- \"event streaming Azure\"\n- \"real-time data ingestion\"\n- \"EventProcessorClient\"\n- \"event hub producer consumer\"\n- \"partition processing\"\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmicrosoft\u002Fskills\u002Fazure-eventhub-java",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":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-java",{"tool":40,"command":41},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-java",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-java","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-eventhub-java\u002FSKILL.md",true,[],[49,63,73,82,88,95],{"skillNo":50,"name":51,"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":52,"categories":53,"keywords":59,"publishedAt":21},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[54],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[60,61,62],"model","model hierarchy","model hierarchy skill",{"skillNo":64,"name":65,"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":66,"categories":67,"keywords":69,"publishedAt":21},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[68],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},[70,71,72],"MCP","zoom","zoom mcp",{"skillNo":74,"name":75,"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":76,"categories":77,"keywords":78,"publishedAt":21},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[79,80,81,71],"sdk","zoom apps sdk","apps",{"skillNo":83,"name":84,"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":85,"categories":86,"keywords":87,"publishedAt":21},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"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":91,"categories":92,"keywords":94,"publishedAt":21},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[93],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},[90],{"skillNo":96,"name":97,"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":98,"categories":99,"keywords":100,"publishedAt":21},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[97]]