[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-microsoft-azure-eventhub-java":3,"mdc-lrmwqe-key":42,"related-repo-microsoft-azure-eventhub-java":2499,"related-org-microsoft-azure-eventhub-java":2607},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":25,"repoUrl":26,"updatedAt":27,"license":28,"forks":29,"topics":30,"repo":37,"sourceUrl":40,"mdContent":41},"azure-eventhub-java","build streaming applications with Azure Event Hubs","Build real-time streaming applications with Azure Event Hubs SDK for Java. Use when implementing event streaming, high-throughput data ingestion, or building event-driven architectures.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"microsoft","Microsoft","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fmicrosoft.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"Azure","azure","tag",{"name":17,"slug":18,"type":15},"Java","java",{"name":20,"slug":21,"type":15},"Data Engineering","data-engineering",{"name":23,"slug":24,"type":15},"Event Hubs","event-hubs",2804,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills","2026-07-07T06:53:29.989593","MIT",315,[31,32,14,33,34,35,36],"agent-skills","agents","foundry","mcp","sdk","skills",{"repoUrl":26,"stars":25,"forks":29,"topics":38,"description":39},[31,32,14,33,34,35,36],"Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Ftree\u002FHEAD\u002F.github\u002Fplugins\u002Fazure-sdk-java\u002Fskills\u002Fazure-eventhub-java","---\nname: azure-eventhub-java\ndescription: Build real-time streaming applications with Azure Event Hubs SDK for Java. Use when implementing event streaming, high-throughput data ingestion, or building event-driven architectures.\nlicense: MIT\nmetadata:\n  author: Microsoft\n  version: \"1.0.0\"\n  package: com.azure:azure-messaging-eventhubs\n---\n\n# 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.core.credential.TokenCredential;\nimport com.azure.identity.AzureIdentityEnvVars;\nimport com.azure.identity.DefaultAzureCredentialBuilder;\nimport com.azure.identity.ManagedIdentityCredentialBuilder;\n\n\u002F\u002F Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\nTokenCredential credential = new DefaultAzureCredentialBuilder()\n    .requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)\n    .build();\n\u002F\u002F Or use a specific credential directly in production:\n\u002F\u002F See https:\u002F\u002Flearn.microsoft.com\u002Fjava\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-java-stable#credential-classes\n\u002F\u002F TokenCredential credential = new ManagedIdentityCredentialBuilder().build();\n\nEventHubProducerClient producer = new EventHubClientBuilder()\n    .fullyQualifiedNamespace(\"\u003Cnamespace>.servicebus.windows.net\")\n    .eventHubName(\"\u003Cevent-hub-name>\")\n    .credential(credential)\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=...  # Alternative to Entra ID auth\nEVENT_HUBS_NAME=\u003Cevent-hub-name>  # Required for event hub name\nSTORAGE_CONNECTION_STRING=\u003Cfor-checkpointing>  # Alternative to Entra ID auth for checkpointing\nAZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production\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",{"data":43,"body":47},{"name":4,"description":6,"license":28,"metadata":44},{"author":9,"version":45,"package":46},"1.0.0","com.azure:azure-messaging-eventhubs",{"type":48,"children":49},"root",[50,59,65,72,192,198,205,305,311,464,470,523,529,620,626,632,670,676,850,856,910,916,967,973,1027,1033,1178,1184,1505,1511,1669,1675,1754,1760,1846,1852,1967,1973,2096,2102,2209,2215,2374,2380,2453,2459,2493],{"type":51,"tag":52,"props":53,"children":55},"element","h1",{"id":54},"azure-event-hubs-sdk-for-java",[56],{"type":57,"value":58},"text","Azure Event Hubs SDK for Java",{"type":51,"tag":60,"props":61,"children":62},"p",{},[63],{"type":57,"value":64},"Build real-time streaming applications using the Azure Event Hubs SDK for Java.",{"type":51,"tag":66,"props":67,"children":69},"h2",{"id":68},"installation",[70],{"type":57,"value":71},"Installation",{"type":51,"tag":73,"props":74,"children":79},"pre",{"className":75,"code":76,"language":77,"meta":78,"style":78},"language-xml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\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","xml","",[80],{"type":51,"tag":81,"props":82,"children":83},"code",{"__ignoreMap":78},[84,95,104,113,122,131,141,150,158,166,175,184],{"type":51,"tag":85,"props":86,"children":89},"span",{"class":87,"line":88},"line",1,[90],{"type":51,"tag":85,"props":91,"children":92},{},[93],{"type":57,"value":94},"\u003Cdependency>\n",{"type":51,"tag":85,"props":96,"children":98},{"class":87,"line":97},2,[99],{"type":51,"tag":85,"props":100,"children":101},{},[102],{"type":57,"value":103},"    \u003CgroupId>com.azure\u003C\u002FgroupId>\n",{"type":51,"tag":85,"props":105,"children":107},{"class":87,"line":106},3,[108],{"type":51,"tag":85,"props":109,"children":110},{},[111],{"type":57,"value":112},"    \u003CartifactId>azure-messaging-eventhubs\u003C\u002FartifactId>\n",{"type":51,"tag":85,"props":114,"children":116},{"class":87,"line":115},4,[117],{"type":51,"tag":85,"props":118,"children":119},{},[120],{"type":57,"value":121},"    \u003Cversion>5.19.0\u003C\u002Fversion>\n",{"type":51,"tag":85,"props":123,"children":125},{"class":87,"line":124},5,[126],{"type":51,"tag":85,"props":127,"children":128},{},[129],{"type":57,"value":130},"\u003C\u002Fdependency>\n",{"type":51,"tag":85,"props":132,"children":134},{"class":87,"line":133},6,[135],{"type":51,"tag":85,"props":136,"children":138},{"emptyLinePlaceholder":137},true,[139],{"type":57,"value":140},"\n",{"type":51,"tag":85,"props":142,"children":144},{"class":87,"line":143},7,[145],{"type":51,"tag":85,"props":146,"children":147},{},[148],{"type":57,"value":149},"\u003C!-- For checkpoint store (production) -->\n",{"type":51,"tag":85,"props":151,"children":153},{"class":87,"line":152},8,[154],{"type":51,"tag":85,"props":155,"children":156},{},[157],{"type":57,"value":94},{"type":51,"tag":85,"props":159,"children":161},{"class":87,"line":160},9,[162],{"type":51,"tag":85,"props":163,"children":164},{},[165],{"type":57,"value":103},{"type":51,"tag":85,"props":167,"children":169},{"class":87,"line":168},10,[170],{"type":51,"tag":85,"props":171,"children":172},{},[173],{"type":57,"value":174},"    \u003CartifactId>azure-messaging-eventhubs-checkpointstore-blob\u003C\u002FartifactId>\n",{"type":51,"tag":85,"props":176,"children":178},{"class":87,"line":177},11,[179],{"type":51,"tag":85,"props":180,"children":181},{},[182],{"type":57,"value":183},"    \u003Cversion>1.20.0\u003C\u002Fversion>\n",{"type":51,"tag":85,"props":185,"children":187},{"class":87,"line":186},12,[188],{"type":51,"tag":85,"props":189,"children":190},{},[191],{"type":57,"value":130},{"type":51,"tag":66,"props":193,"children":195},{"id":194},"client-creation",[196],{"type":57,"value":197},"Client Creation",{"type":51,"tag":199,"props":200,"children":202},"h3",{"id":201},"eventhubproducerclient",[203],{"type":57,"value":204},"EventHubProducerClient",{"type":51,"tag":73,"props":206,"children":209},{"className":207,"code":208,"language":18,"meta":78,"style":78},"language-java shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import 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",[210],{"type":51,"tag":81,"props":211,"children":212},{"__ignoreMap":78},[213,221,229,236,244,252,260,268,275,283,290,298],{"type":51,"tag":85,"props":214,"children":215},{"class":87,"line":88},[216],{"type":51,"tag":85,"props":217,"children":218},{},[219],{"type":57,"value":220},"import com.azure.messaging.eventhubs.EventHubProducerClient;\n",{"type":51,"tag":85,"props":222,"children":223},{"class":87,"line":97},[224],{"type":51,"tag":85,"props":225,"children":226},{},[227],{"type":57,"value":228},"import com.azure.messaging.eventhubs.EventHubClientBuilder;\n",{"type":51,"tag":85,"props":230,"children":231},{"class":87,"line":106},[232],{"type":51,"tag":85,"props":233,"children":234},{"emptyLinePlaceholder":137},[235],{"type":57,"value":140},{"type":51,"tag":85,"props":237,"children":238},{"class":87,"line":115},[239],{"type":51,"tag":85,"props":240,"children":241},{},[242],{"type":57,"value":243},"\u002F\u002F With connection string\n",{"type":51,"tag":85,"props":245,"children":246},{"class":87,"line":124},[247],{"type":51,"tag":85,"props":248,"children":249},{},[250],{"type":57,"value":251},"EventHubProducerClient producer = new EventHubClientBuilder()\n",{"type":51,"tag":85,"props":253,"children":254},{"class":87,"line":133},[255],{"type":51,"tag":85,"props":256,"children":257},{},[258],{"type":57,"value":259},"    .connectionString(\"\u003Cconnection-string>\", \"\u003Cevent-hub-name>\")\n",{"type":51,"tag":85,"props":261,"children":262},{"class":87,"line":143},[263],{"type":51,"tag":85,"props":264,"children":265},{},[266],{"type":57,"value":267},"    .buildProducerClient();\n",{"type":51,"tag":85,"props":269,"children":270},{"class":87,"line":152},[271],{"type":51,"tag":85,"props":272,"children":273},{"emptyLinePlaceholder":137},[274],{"type":57,"value":140},{"type":51,"tag":85,"props":276,"children":277},{"class":87,"line":160},[278],{"type":51,"tag":85,"props":279,"children":280},{},[281],{"type":57,"value":282},"\u002F\u002F Full connection string with EntityPath\n",{"type":51,"tag":85,"props":284,"children":285},{"class":87,"line":168},[286],{"type":51,"tag":85,"props":287,"children":288},{},[289],{"type":57,"value":251},{"type":51,"tag":85,"props":291,"children":292},{"class":87,"line":177},[293],{"type":51,"tag":85,"props":294,"children":295},{},[296],{"type":57,"value":297},"    .connectionString(\"\u003Cconnection-string-with-entity-path>\")\n",{"type":51,"tag":85,"props":299,"children":300},{"class":87,"line":186},[301],{"type":51,"tag":85,"props":302,"children":303},{},[304],{"type":57,"value":267},{"type":51,"tag":199,"props":306,"children":308},{"id":307},"with-defaultazurecredential",[309],{"type":57,"value":310},"With DefaultAzureCredential",{"type":51,"tag":73,"props":312,"children":314},{"className":207,"code":313,"language":18,"meta":78,"style":78},"import com.azure.core.credential.TokenCredential;\nimport com.azure.identity.AzureIdentityEnvVars;\nimport com.azure.identity.DefaultAzureCredentialBuilder;\nimport com.azure.identity.ManagedIdentityCredentialBuilder;\n\n\u002F\u002F Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\nTokenCredential credential = new DefaultAzureCredentialBuilder()\n    .requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)\n    .build();\n\u002F\u002F Or use a specific credential directly in production:\n\u002F\u002F See https:\u002F\u002Flearn.microsoft.com\u002Fjava\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-java-stable#credential-classes\n\u002F\u002F TokenCredential credential = new ManagedIdentityCredentialBuilder().build();\n\nEventHubProducerClient producer = new EventHubClientBuilder()\n    .fullyQualifiedNamespace(\"\u003Cnamespace>.servicebus.windows.net\")\n    .eventHubName(\"\u003Cevent-hub-name>\")\n    .credential(credential)\n    .buildProducerClient();\n",[315],{"type":51,"tag":81,"props":316,"children":317},{"__ignoreMap":78},[318,326,334,342,350,357,365,373,381,389,397,405,413,421,429,438,447,456],{"type":51,"tag":85,"props":319,"children":320},{"class":87,"line":88},[321],{"type":51,"tag":85,"props":322,"children":323},{},[324],{"type":57,"value":325},"import com.azure.core.credential.TokenCredential;\n",{"type":51,"tag":85,"props":327,"children":328},{"class":87,"line":97},[329],{"type":51,"tag":85,"props":330,"children":331},{},[332],{"type":57,"value":333},"import com.azure.identity.AzureIdentityEnvVars;\n",{"type":51,"tag":85,"props":335,"children":336},{"class":87,"line":106},[337],{"type":51,"tag":85,"props":338,"children":339},{},[340],{"type":57,"value":341},"import com.azure.identity.DefaultAzureCredentialBuilder;\n",{"type":51,"tag":85,"props":343,"children":344},{"class":87,"line":115},[345],{"type":51,"tag":85,"props":346,"children":347},{},[348],{"type":57,"value":349},"import com.azure.identity.ManagedIdentityCredentialBuilder;\n",{"type":51,"tag":85,"props":351,"children":352},{"class":87,"line":124},[353],{"type":51,"tag":85,"props":354,"children":355},{"emptyLinePlaceholder":137},[356],{"type":57,"value":140},{"type":51,"tag":85,"props":358,"children":359},{"class":87,"line":133},[360],{"type":51,"tag":85,"props":361,"children":362},{},[363],{"type":57,"value":364},"\u002F\u002F Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\n",{"type":51,"tag":85,"props":366,"children":367},{"class":87,"line":143},[368],{"type":51,"tag":85,"props":369,"children":370},{},[371],{"type":57,"value":372},"TokenCredential credential = new DefaultAzureCredentialBuilder()\n",{"type":51,"tag":85,"props":374,"children":375},{"class":87,"line":152},[376],{"type":51,"tag":85,"props":377,"children":378},{},[379],{"type":57,"value":380},"    .requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)\n",{"type":51,"tag":85,"props":382,"children":383},{"class":87,"line":160},[384],{"type":51,"tag":85,"props":385,"children":386},{},[387],{"type":57,"value":388},"    .build();\n",{"type":51,"tag":85,"props":390,"children":391},{"class":87,"line":168},[392],{"type":51,"tag":85,"props":393,"children":394},{},[395],{"type":57,"value":396},"\u002F\u002F Or use a specific credential directly in production:\n",{"type":51,"tag":85,"props":398,"children":399},{"class":87,"line":177},[400],{"type":51,"tag":85,"props":401,"children":402},{},[403],{"type":57,"value":404},"\u002F\u002F See https:\u002F\u002Flearn.microsoft.com\u002Fjava\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-java-stable#credential-classes\n",{"type":51,"tag":85,"props":406,"children":407},{"class":87,"line":186},[408],{"type":51,"tag":85,"props":409,"children":410},{},[411],{"type":57,"value":412},"\u002F\u002F TokenCredential credential = new ManagedIdentityCredentialBuilder().build();\n",{"type":51,"tag":85,"props":414,"children":416},{"class":87,"line":415},13,[417],{"type":51,"tag":85,"props":418,"children":419},{"emptyLinePlaceholder":137},[420],{"type":57,"value":140},{"type":51,"tag":85,"props":422,"children":424},{"class":87,"line":423},14,[425],{"type":51,"tag":85,"props":426,"children":427},{},[428],{"type":57,"value":251},{"type":51,"tag":85,"props":430,"children":432},{"class":87,"line":431},15,[433],{"type":51,"tag":85,"props":434,"children":435},{},[436],{"type":57,"value":437},"    .fullyQualifiedNamespace(\"\u003Cnamespace>.servicebus.windows.net\")\n",{"type":51,"tag":85,"props":439,"children":441},{"class":87,"line":440},16,[442],{"type":51,"tag":85,"props":443,"children":444},{},[445],{"type":57,"value":446},"    .eventHubName(\"\u003Cevent-hub-name>\")\n",{"type":51,"tag":85,"props":448,"children":450},{"class":87,"line":449},17,[451],{"type":51,"tag":85,"props":452,"children":453},{},[454],{"type":57,"value":455},"    .credential(credential)\n",{"type":51,"tag":85,"props":457,"children":459},{"class":87,"line":458},18,[460],{"type":51,"tag":85,"props":461,"children":462},{},[463],{"type":57,"value":267},{"type":51,"tag":199,"props":465,"children":467},{"id":466},"eventhubconsumerclient",[468],{"type":57,"value":469},"EventHubConsumerClient",{"type":51,"tag":73,"props":471,"children":473},{"className":207,"code":472,"language":18,"meta":78,"style":78},"import 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",[474],{"type":51,"tag":81,"props":475,"children":476},{"__ignoreMap":78},[477,485,492,500,507,515],{"type":51,"tag":85,"props":478,"children":479},{"class":87,"line":88},[480],{"type":51,"tag":85,"props":481,"children":482},{},[483],{"type":57,"value":484},"import com.azure.messaging.eventhubs.EventHubConsumerClient;\n",{"type":51,"tag":85,"props":486,"children":487},{"class":87,"line":97},[488],{"type":51,"tag":85,"props":489,"children":490},{"emptyLinePlaceholder":137},[491],{"type":57,"value":140},{"type":51,"tag":85,"props":493,"children":494},{"class":87,"line":106},[495],{"type":51,"tag":85,"props":496,"children":497},{},[498],{"type":57,"value":499},"EventHubConsumerClient consumer = new EventHubClientBuilder()\n",{"type":51,"tag":85,"props":501,"children":502},{"class":87,"line":115},[503],{"type":51,"tag":85,"props":504,"children":505},{},[506],{"type":57,"value":259},{"type":51,"tag":85,"props":508,"children":509},{"class":87,"line":124},[510],{"type":51,"tag":85,"props":511,"children":512},{},[513],{"type":57,"value":514},"    .consumerGroup(EventHubClientBuilder.DEFAULT_CONSUMER_GROUP_NAME)\n",{"type":51,"tag":85,"props":516,"children":517},{"class":87,"line":133},[518],{"type":51,"tag":85,"props":519,"children":520},{},[521],{"type":57,"value":522},"    .buildConsumerClient();\n",{"type":51,"tag":199,"props":524,"children":526},{"id":525},"async-clients",[527],{"type":57,"value":528},"Async Clients",{"type":51,"tag":73,"props":530,"children":532},{"className":207,"code":531,"language":18,"meta":78,"style":78},"import 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",[533],{"type":51,"tag":81,"props":534,"children":535},{"__ignoreMap":78},[536,544,552,559,567,574,582,589,597,604,612],{"type":51,"tag":85,"props":537,"children":538},{"class":87,"line":88},[539],{"type":51,"tag":85,"props":540,"children":541},{},[542],{"type":57,"value":543},"import com.azure.messaging.eventhubs.EventHubProducerAsyncClient;\n",{"type":51,"tag":85,"props":545,"children":546},{"class":87,"line":97},[547],{"type":51,"tag":85,"props":548,"children":549},{},[550],{"type":57,"value":551},"import com.azure.messaging.eventhubs.EventHubConsumerAsyncClient;\n",{"type":51,"tag":85,"props":553,"children":554},{"class":87,"line":106},[555],{"type":51,"tag":85,"props":556,"children":557},{"emptyLinePlaceholder":137},[558],{"type":57,"value":140},{"type":51,"tag":85,"props":560,"children":561},{"class":87,"line":115},[562],{"type":51,"tag":85,"props":563,"children":564},{},[565],{"type":57,"value":566},"EventHubProducerAsyncClient asyncProducer = new EventHubClientBuilder()\n",{"type":51,"tag":85,"props":568,"children":569},{"class":87,"line":124},[570],{"type":51,"tag":85,"props":571,"children":572},{},[573],{"type":57,"value":259},{"type":51,"tag":85,"props":575,"children":576},{"class":87,"line":133},[577],{"type":51,"tag":85,"props":578,"children":579},{},[580],{"type":57,"value":581},"    .buildAsyncProducerClient();\n",{"type":51,"tag":85,"props":583,"children":584},{"class":87,"line":143},[585],{"type":51,"tag":85,"props":586,"children":587},{"emptyLinePlaceholder":137},[588],{"type":57,"value":140},{"type":51,"tag":85,"props":590,"children":591},{"class":87,"line":152},[592],{"type":51,"tag":85,"props":593,"children":594},{},[595],{"type":57,"value":596},"EventHubConsumerAsyncClient asyncConsumer = new EventHubClientBuilder()\n",{"type":51,"tag":85,"props":598,"children":599},{"class":87,"line":160},[600],{"type":51,"tag":85,"props":601,"children":602},{},[603],{"type":57,"value":259},{"type":51,"tag":85,"props":605,"children":606},{"class":87,"line":168},[607],{"type":51,"tag":85,"props":608,"children":609},{},[610],{"type":57,"value":611},"    .consumerGroup(\"$Default\")\n",{"type":51,"tag":85,"props":613,"children":614},{"class":87,"line":177},[615],{"type":51,"tag":85,"props":616,"children":617},{},[618],{"type":57,"value":619},"    .buildAsyncConsumerClient();\n",{"type":51,"tag":66,"props":621,"children":623},{"id":622},"core-patterns",[624],{"type":57,"value":625},"Core Patterns",{"type":51,"tag":199,"props":627,"children":629},{"id":628},"send-single-event",[630],{"type":57,"value":631},"Send Single Event",{"type":51,"tag":73,"props":633,"children":635},{"className":207,"code":634,"language":18,"meta":78,"style":78},"import com.azure.messaging.eventhubs.EventData;\n\nEventData eventData = new EventData(\"Hello, Event Hubs!\");\nproducer.send(Collections.singletonList(eventData));\n",[636],{"type":51,"tag":81,"props":637,"children":638},{"__ignoreMap":78},[639,647,654,662],{"type":51,"tag":85,"props":640,"children":641},{"class":87,"line":88},[642],{"type":51,"tag":85,"props":643,"children":644},{},[645],{"type":57,"value":646},"import com.azure.messaging.eventhubs.EventData;\n",{"type":51,"tag":85,"props":648,"children":649},{"class":87,"line":97},[650],{"type":51,"tag":85,"props":651,"children":652},{"emptyLinePlaceholder":137},[653],{"type":57,"value":140},{"type":51,"tag":85,"props":655,"children":656},{"class":87,"line":106},[657],{"type":51,"tag":85,"props":658,"children":659},{},[660],{"type":57,"value":661},"EventData eventData = new EventData(\"Hello, Event Hubs!\");\n",{"type":51,"tag":85,"props":663,"children":664},{"class":87,"line":115},[665],{"type":51,"tag":85,"props":666,"children":667},{},[668],{"type":57,"value":669},"producer.send(Collections.singletonList(eventData));\n",{"type":51,"tag":199,"props":671,"children":673},{"id":672},"send-event-batch",[674],{"type":57,"value":675},"Send Event Batch",{"type":51,"tag":73,"props":677,"children":679},{"className":207,"code":678,"language":18,"meta":78,"style":78},"import 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",[680],{"type":51,"tag":81,"props":681,"children":682},{"__ignoreMap":78},[683,691,699,706,714,722,729,737,745,753,761,769,777,785,793,801,809,816,824,833,842],{"type":51,"tag":85,"props":684,"children":685},{"class":87,"line":88},[686],{"type":51,"tag":85,"props":687,"children":688},{},[689],{"type":57,"value":690},"import com.azure.messaging.eventhubs.EventDataBatch;\n",{"type":51,"tag":85,"props":692,"children":693},{"class":87,"line":97},[694],{"type":51,"tag":85,"props":695,"children":696},{},[697],{"type":57,"value":698},"import com.azure.messaging.eventhubs.models.CreateBatchOptions;\n",{"type":51,"tag":85,"props":700,"children":701},{"class":87,"line":106},[702],{"type":51,"tag":85,"props":703,"children":704},{"emptyLinePlaceholder":137},[705],{"type":57,"value":140},{"type":51,"tag":85,"props":707,"children":708},{"class":87,"line":115},[709],{"type":51,"tag":85,"props":710,"children":711},{},[712],{"type":57,"value":713},"\u002F\u002F Create batch\n",{"type":51,"tag":85,"props":715,"children":716},{"class":87,"line":124},[717],{"type":51,"tag":85,"props":718,"children":719},{},[720],{"type":57,"value":721},"EventDataBatch batch = producer.createBatch();\n",{"type":51,"tag":85,"props":723,"children":724},{"class":87,"line":133},[725],{"type":51,"tag":85,"props":726,"children":727},{"emptyLinePlaceholder":137},[728],{"type":57,"value":140},{"type":51,"tag":85,"props":730,"children":731},{"class":87,"line":143},[732],{"type":51,"tag":85,"props":733,"children":734},{},[735],{"type":57,"value":736},"\u002F\u002F Add events (returns false if batch is full)\n",{"type":51,"tag":85,"props":738,"children":739},{"class":87,"line":152},[740],{"type":51,"tag":85,"props":741,"children":742},{},[743],{"type":57,"value":744},"for (int i = 0; i \u003C 100; i++) {\n",{"type":51,"tag":85,"props":746,"children":747},{"class":87,"line":160},[748],{"type":51,"tag":85,"props":749,"children":750},{},[751],{"type":57,"value":752},"    EventData event = new EventData(\"Event \" + i);\n",{"type":51,"tag":85,"props":754,"children":755},{"class":87,"line":168},[756],{"type":51,"tag":85,"props":757,"children":758},{},[759],{"type":57,"value":760},"    if (!batch.tryAdd(event)) {\n",{"type":51,"tag":85,"props":762,"children":763},{"class":87,"line":177},[764],{"type":51,"tag":85,"props":765,"children":766},{},[767],{"type":57,"value":768},"        \u002F\u002F Batch is full, send and create new batch\n",{"type":51,"tag":85,"props":770,"children":771},{"class":87,"line":186},[772],{"type":51,"tag":85,"props":773,"children":774},{},[775],{"type":57,"value":776},"        producer.send(batch);\n",{"type":51,"tag":85,"props":778,"children":779},{"class":87,"line":415},[780],{"type":51,"tag":85,"props":781,"children":782},{},[783],{"type":57,"value":784},"        batch = producer.createBatch();\n",{"type":51,"tag":85,"props":786,"children":787},{"class":87,"line":423},[788],{"type":51,"tag":85,"props":789,"children":790},{},[791],{"type":57,"value":792},"        batch.tryAdd(event);\n",{"type":51,"tag":85,"props":794,"children":795},{"class":87,"line":431},[796],{"type":51,"tag":85,"props":797,"children":798},{},[799],{"type":57,"value":800},"    }\n",{"type":51,"tag":85,"props":802,"children":803},{"class":87,"line":440},[804],{"type":51,"tag":85,"props":805,"children":806},{},[807],{"type":57,"value":808},"}\n",{"type":51,"tag":85,"props":810,"children":811},{"class":87,"line":449},[812],{"type":51,"tag":85,"props":813,"children":814},{"emptyLinePlaceholder":137},[815],{"type":57,"value":140},{"type":51,"tag":85,"props":817,"children":818},{"class":87,"line":458},[819],{"type":51,"tag":85,"props":820,"children":821},{},[822],{"type":57,"value":823},"\u002F\u002F Send remaining events\n",{"type":51,"tag":85,"props":825,"children":827},{"class":87,"line":826},19,[828],{"type":51,"tag":85,"props":829,"children":830},{},[831],{"type":57,"value":832},"if (batch.getCount() > 0) {\n",{"type":51,"tag":85,"props":834,"children":836},{"class":87,"line":835},20,[837],{"type":51,"tag":85,"props":838,"children":839},{},[840],{"type":57,"value":841},"    producer.send(batch);\n",{"type":51,"tag":85,"props":843,"children":845},{"class":87,"line":844},21,[846],{"type":51,"tag":85,"props":847,"children":848},{},[849],{"type":57,"value":808},{"type":51,"tag":199,"props":851,"children":853},{"id":852},"send-to-specific-partition",[854],{"type":57,"value":855},"Send to Specific Partition",{"type":51,"tag":73,"props":857,"children":859},{"className":207,"code":858,"language":18,"meta":78,"style":78},"CreateBatchOptions options = new CreateBatchOptions()\n    .setPartitionId(\"0\");\n\nEventDataBatch batch = producer.createBatch(options);\nbatch.tryAdd(new EventData(\"Partition 0 event\"));\nproducer.send(batch);\n",[860],{"type":51,"tag":81,"props":861,"children":862},{"__ignoreMap":78},[863,871,879,886,894,902],{"type":51,"tag":85,"props":864,"children":865},{"class":87,"line":88},[866],{"type":51,"tag":85,"props":867,"children":868},{},[869],{"type":57,"value":870},"CreateBatchOptions options = new CreateBatchOptions()\n",{"type":51,"tag":85,"props":872,"children":873},{"class":87,"line":97},[874],{"type":51,"tag":85,"props":875,"children":876},{},[877],{"type":57,"value":878},"    .setPartitionId(\"0\");\n",{"type":51,"tag":85,"props":880,"children":881},{"class":87,"line":106},[882],{"type":51,"tag":85,"props":883,"children":884},{"emptyLinePlaceholder":137},[885],{"type":57,"value":140},{"type":51,"tag":85,"props":887,"children":888},{"class":87,"line":115},[889],{"type":51,"tag":85,"props":890,"children":891},{},[892],{"type":57,"value":893},"EventDataBatch batch = producer.createBatch(options);\n",{"type":51,"tag":85,"props":895,"children":896},{"class":87,"line":124},[897],{"type":51,"tag":85,"props":898,"children":899},{},[900],{"type":57,"value":901},"batch.tryAdd(new EventData(\"Partition 0 event\"));\n",{"type":51,"tag":85,"props":903,"children":904},{"class":87,"line":133},[905],{"type":51,"tag":85,"props":906,"children":907},{},[908],{"type":57,"value":909},"producer.send(batch);\n",{"type":51,"tag":199,"props":911,"children":913},{"id":912},"send-with-partition-key",[914],{"type":57,"value":915},"Send with Partition Key",{"type":51,"tag":73,"props":917,"children":919},{"className":207,"code":918,"language":18,"meta":78,"style":78},"CreateBatchOptions options = new CreateBatchOptions()\n    .setPartitionKey(\"customer-123\");\n\nEventDataBatch batch = producer.createBatch(options);\nbatch.tryAdd(new EventData(\"Customer event\"));\nproducer.send(batch);\n",[920],{"type":51,"tag":81,"props":921,"children":922},{"__ignoreMap":78},[923,930,938,945,952,960],{"type":51,"tag":85,"props":924,"children":925},{"class":87,"line":88},[926],{"type":51,"tag":85,"props":927,"children":928},{},[929],{"type":57,"value":870},{"type":51,"tag":85,"props":931,"children":932},{"class":87,"line":97},[933],{"type":51,"tag":85,"props":934,"children":935},{},[936],{"type":57,"value":937},"    .setPartitionKey(\"customer-123\");\n",{"type":51,"tag":85,"props":939,"children":940},{"class":87,"line":106},[941],{"type":51,"tag":85,"props":942,"children":943},{"emptyLinePlaceholder":137},[944],{"type":57,"value":140},{"type":51,"tag":85,"props":946,"children":947},{"class":87,"line":115},[948],{"type":51,"tag":85,"props":949,"children":950},{},[951],{"type":57,"value":893},{"type":51,"tag":85,"props":953,"children":954},{"class":87,"line":124},[955],{"type":51,"tag":85,"props":956,"children":957},{},[958],{"type":57,"value":959},"batch.tryAdd(new EventData(\"Customer event\"));\n",{"type":51,"tag":85,"props":961,"children":962},{"class":87,"line":133},[963],{"type":51,"tag":85,"props":964,"children":965},{},[966],{"type":57,"value":909},{"type":51,"tag":199,"props":968,"children":970},{"id":969},"event-with-properties",[971],{"type":57,"value":972},"Event with Properties",{"type":51,"tag":73,"props":974,"children":976},{"className":207,"code":975,"language":18,"meta":78,"style":78},"EventData 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",[977],{"type":51,"tag":81,"props":978,"children":979},{"__ignoreMap":78},[980,988,996,1004,1012,1019],{"type":51,"tag":85,"props":981,"children":982},{"class":87,"line":88},[983],{"type":51,"tag":85,"props":984,"children":985},{},[986],{"type":57,"value":987},"EventData event = new EventData(\"Order created\");\n",{"type":51,"tag":85,"props":989,"children":990},{"class":87,"line":97},[991],{"type":51,"tag":85,"props":992,"children":993},{},[994],{"type":57,"value":995},"event.getProperties().put(\"orderId\", \"ORD-123\");\n",{"type":51,"tag":85,"props":997,"children":998},{"class":87,"line":106},[999],{"type":51,"tag":85,"props":1000,"children":1001},{},[1002],{"type":57,"value":1003},"event.getProperties().put(\"customerId\", \"CUST-456\");\n",{"type":51,"tag":85,"props":1005,"children":1006},{"class":87,"line":115},[1007],{"type":51,"tag":85,"props":1008,"children":1009},{},[1010],{"type":57,"value":1011},"event.getProperties().put(\"priority\", 1);\n",{"type":51,"tag":85,"props":1013,"children":1014},{"class":87,"line":124},[1015],{"type":51,"tag":85,"props":1016,"children":1017},{"emptyLinePlaceholder":137},[1018],{"type":57,"value":140},{"type":51,"tag":85,"props":1020,"children":1021},{"class":87,"line":133},[1022],{"type":51,"tag":85,"props":1023,"children":1024},{},[1025],{"type":57,"value":1026},"producer.send(Collections.singletonList(event));\n",{"type":51,"tag":199,"props":1028,"children":1030},{"id":1029},"receive-events-simple",[1031],{"type":57,"value":1032},"Receive Events (Simple)",{"type":51,"tag":73,"props":1034,"children":1036},{"className":207,"code":1035,"language":18,"meta":78,"style":78},"import 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",[1037],{"type":51,"tag":81,"props":1038,"children":1039},{"__ignoreMap":78},[1040,1048,1056,1063,1071,1079,1092,1100,1108,1116,1124,1131,1139,1147,1155,1163,1171],{"type":51,"tag":85,"props":1041,"children":1042},{"class":87,"line":88},[1043],{"type":51,"tag":85,"props":1044,"children":1045},{},[1046],{"type":57,"value":1047},"import com.azure.messaging.eventhubs.models.EventPosition;\n",{"type":51,"tag":85,"props":1049,"children":1050},{"class":87,"line":97},[1051],{"type":51,"tag":85,"props":1052,"children":1053},{},[1054],{"type":57,"value":1055},"import com.azure.messaging.eventhubs.models.PartitionEvent;\n",{"type":51,"tag":85,"props":1057,"children":1058},{"class":87,"line":106},[1059],{"type":51,"tag":85,"props":1060,"children":1061},{"emptyLinePlaceholder":137},[1062],{"type":57,"value":140},{"type":51,"tag":85,"props":1064,"children":1065},{"class":87,"line":115},[1066],{"type":51,"tag":85,"props":1067,"children":1068},{},[1069],{"type":57,"value":1070},"\u002F\u002F Receive from specific partition\n",{"type":51,"tag":85,"props":1072,"children":1073},{"class":87,"line":124},[1074],{"type":51,"tag":85,"props":1075,"children":1076},{},[1077],{"type":57,"value":1078},"Iterable\u003CPartitionEvent> events = consumer.receiveFromPartition(\n",{"type":51,"tag":85,"props":1080,"children":1081},{"class":87,"line":133},[1082,1087],{"type":51,"tag":85,"props":1083,"children":1084},{},[1085],{"type":57,"value":1086},"    \"0\",",{"type":51,"tag":85,"props":1088,"children":1089},{},[1090],{"type":57,"value":1091},"                           \u002F\u002F partitionId\n",{"type":51,"tag":85,"props":1093,"children":1094},{"class":87,"line":143},[1095],{"type":51,"tag":85,"props":1096,"children":1097},{},[1098],{"type":57,"value":1099},"    10,                            \u002F\u002F maxEvents\n",{"type":51,"tag":85,"props":1101,"children":1102},{"class":87,"line":152},[1103],{"type":51,"tag":85,"props":1104,"children":1105},{},[1106],{"type":57,"value":1107},"    EventPosition.earliest(),      \u002F\u002F startingPosition\n",{"type":51,"tag":85,"props":1109,"children":1110},{"class":87,"line":160},[1111],{"type":51,"tag":85,"props":1112,"children":1113},{},[1114],{"type":57,"value":1115},"    Duration.ofSeconds(30)         \u002F\u002F timeout\n",{"type":51,"tag":85,"props":1117,"children":1118},{"class":87,"line":168},[1119],{"type":51,"tag":85,"props":1120,"children":1121},{},[1122],{"type":57,"value":1123},");\n",{"type":51,"tag":85,"props":1125,"children":1126},{"class":87,"line":177},[1127],{"type":51,"tag":85,"props":1128,"children":1129},{"emptyLinePlaceholder":137},[1130],{"type":57,"value":140},{"type":51,"tag":85,"props":1132,"children":1133},{"class":87,"line":186},[1134],{"type":51,"tag":85,"props":1135,"children":1136},{},[1137],{"type":57,"value":1138},"for (PartitionEvent partitionEvent : events) {\n",{"type":51,"tag":85,"props":1140,"children":1141},{"class":87,"line":415},[1142],{"type":51,"tag":85,"props":1143,"children":1144},{},[1145],{"type":57,"value":1146},"    EventData event = partitionEvent.getData();\n",{"type":51,"tag":85,"props":1148,"children":1149},{"class":87,"line":423},[1150],{"type":51,"tag":85,"props":1151,"children":1152},{},[1153],{"type":57,"value":1154},"    System.out.println(\"Body: \" + event.getBodyAsString());\n",{"type":51,"tag":85,"props":1156,"children":1157},{"class":87,"line":431},[1158],{"type":51,"tag":85,"props":1159,"children":1160},{},[1161],{"type":57,"value":1162},"    System.out.println(\"Sequence: \" + event.getSequenceNumber());\n",{"type":51,"tag":85,"props":1164,"children":1165},{"class":87,"line":440},[1166],{"type":51,"tag":85,"props":1167,"children":1168},{},[1169],{"type":57,"value":1170},"    System.out.println(\"Offset: \" + event.getOffset());\n",{"type":51,"tag":85,"props":1172,"children":1173},{"class":87,"line":449},[1174],{"type":51,"tag":85,"props":1175,"children":1176},{},[1177],{"type":57,"value":808},{"type":51,"tag":199,"props":1179,"children":1181},{"id":1180},"eventprocessorclient-production",[1182],{"type":57,"value":1183},"EventProcessorClient (Production)",{"type":51,"tag":73,"props":1185,"children":1187},{"className":207,"code":1186,"language":18,"meta":78,"style":78},"import 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",[1188],{"type":51,"tag":81,"props":1189,"children":1190},{"__ignoreMap":78},[1191,1199,1207,1215,1223,1231,1238,1246,1254,1262,1270,1278,1285,1293,1301,1309,1316,1324,1332,1340,1348,1356,1365,1374,1383,1392,1401,1410,1418,1427,1435,1444,1453,1461,1470,1479,1487,1496],{"type":51,"tag":85,"props":1192,"children":1193},{"class":87,"line":88},[1194],{"type":51,"tag":85,"props":1195,"children":1196},{},[1197],{"type":57,"value":1198},"import com.azure.messaging.eventhubs.EventProcessorClient;\n",{"type":51,"tag":85,"props":1200,"children":1201},{"class":87,"line":97},[1202],{"type":51,"tag":85,"props":1203,"children":1204},{},[1205],{"type":57,"value":1206},"import com.azure.messaging.eventhubs.EventProcessorClientBuilder;\n",{"type":51,"tag":85,"props":1208,"children":1209},{"class":87,"line":106},[1210],{"type":51,"tag":85,"props":1211,"children":1212},{},[1213],{"type":57,"value":1214},"import com.azure.messaging.eventhubs.checkpointstore.blob.BlobCheckpointStore;\n",{"type":51,"tag":85,"props":1216,"children":1217},{"class":87,"line":115},[1218],{"type":51,"tag":85,"props":1219,"children":1220},{},[1221],{"type":57,"value":1222},"import com.azure.storage.blob.BlobContainerAsyncClient;\n",{"type":51,"tag":85,"props":1224,"children":1225},{"class":87,"line":124},[1226],{"type":51,"tag":85,"props":1227,"children":1228},{},[1229],{"type":57,"value":1230},"import com.azure.storage.blob.BlobContainerClientBuilder;\n",{"type":51,"tag":85,"props":1232,"children":1233},{"class":87,"line":133},[1234],{"type":51,"tag":85,"props":1235,"children":1236},{"emptyLinePlaceholder":137},[1237],{"type":57,"value":140},{"type":51,"tag":85,"props":1239,"children":1240},{"class":87,"line":143},[1241],{"type":51,"tag":85,"props":1242,"children":1243},{},[1244],{"type":57,"value":1245},"\u002F\u002F Create checkpoint store\n",{"type":51,"tag":85,"props":1247,"children":1248},{"class":87,"line":152},[1249],{"type":51,"tag":85,"props":1250,"children":1251},{},[1252],{"type":57,"value":1253},"BlobContainerAsyncClient blobClient = new BlobContainerClientBuilder()\n",{"type":51,"tag":85,"props":1255,"children":1256},{"class":87,"line":160},[1257],{"type":51,"tag":85,"props":1258,"children":1259},{},[1260],{"type":57,"value":1261},"    .connectionString(\"\u003Cstorage-connection-string>\")\n",{"type":51,"tag":85,"props":1263,"children":1264},{"class":87,"line":168},[1265],{"type":51,"tag":85,"props":1266,"children":1267},{},[1268],{"type":57,"value":1269},"    .containerName(\"checkpoints\")\n",{"type":51,"tag":85,"props":1271,"children":1272},{"class":87,"line":177},[1273],{"type":51,"tag":85,"props":1274,"children":1275},{},[1276],{"type":57,"value":1277},"    .buildAsyncClient();\n",{"type":51,"tag":85,"props":1279,"children":1280},{"class":87,"line":186},[1281],{"type":51,"tag":85,"props":1282,"children":1283},{"emptyLinePlaceholder":137},[1284],{"type":57,"value":140},{"type":51,"tag":85,"props":1286,"children":1287},{"class":87,"line":415},[1288],{"type":51,"tag":85,"props":1289,"children":1290},{},[1291],{"type":57,"value":1292},"\u002F\u002F Create processor\n",{"type":51,"tag":85,"props":1294,"children":1295},{"class":87,"line":423},[1296],{"type":51,"tag":85,"props":1297,"children":1298},{},[1299],{"type":57,"value":1300},"EventProcessorClient processor = new EventProcessorClientBuilder()\n",{"type":51,"tag":85,"props":1302,"children":1303},{"class":87,"line":431},[1304],{"type":51,"tag":85,"props":1305,"children":1306},{},[1307],{"type":57,"value":1308},"    .connectionString(\"\u003Ceventhub-connection-string>\", \"\u003Cevent-hub-name>\")\n",{"type":51,"tag":85,"props":1310,"children":1311},{"class":87,"line":440},[1312],{"type":51,"tag":85,"props":1313,"children":1314},{},[1315],{"type":57,"value":611},{"type":51,"tag":85,"props":1317,"children":1318},{"class":87,"line":449},[1319],{"type":51,"tag":85,"props":1320,"children":1321},{},[1322],{"type":57,"value":1323},"    .checkpointStore(new BlobCheckpointStore(blobClient))\n",{"type":51,"tag":85,"props":1325,"children":1326},{"class":87,"line":458},[1327],{"type":51,"tag":85,"props":1328,"children":1329},{},[1330],{"type":57,"value":1331},"    .processEvent(eventContext -> {\n",{"type":51,"tag":85,"props":1333,"children":1334},{"class":87,"line":826},[1335],{"type":51,"tag":85,"props":1336,"children":1337},{},[1338],{"type":57,"value":1339},"        EventData event = eventContext.getEventData();\n",{"type":51,"tag":85,"props":1341,"children":1342},{"class":87,"line":835},[1343],{"type":51,"tag":85,"props":1344,"children":1345},{},[1346],{"type":57,"value":1347},"        System.out.println(\"Processing: \" + event.getBodyAsString());\n",{"type":51,"tag":85,"props":1349,"children":1350},{"class":87,"line":844},[1351],{"type":51,"tag":85,"props":1352,"children":1353},{},[1354],{"type":57,"value":1355},"        \n",{"type":51,"tag":85,"props":1357,"children":1359},{"class":87,"line":1358},22,[1360],{"type":51,"tag":85,"props":1361,"children":1362},{},[1363],{"type":57,"value":1364},"        \u002F\u002F Checkpoint after processing\n",{"type":51,"tag":85,"props":1366,"children":1368},{"class":87,"line":1367},23,[1369],{"type":51,"tag":85,"props":1370,"children":1371},{},[1372],{"type":57,"value":1373},"        eventContext.updateCheckpoint();\n",{"type":51,"tag":85,"props":1375,"children":1377},{"class":87,"line":1376},24,[1378],{"type":51,"tag":85,"props":1379,"children":1380},{},[1381],{"type":57,"value":1382},"    })\n",{"type":51,"tag":85,"props":1384,"children":1386},{"class":87,"line":1385},25,[1387],{"type":51,"tag":85,"props":1388,"children":1389},{},[1390],{"type":57,"value":1391},"    .processError(errorContext -> {\n",{"type":51,"tag":85,"props":1393,"children":1395},{"class":87,"line":1394},26,[1396],{"type":51,"tag":85,"props":1397,"children":1398},{},[1399],{"type":57,"value":1400},"        System.err.println(\"Error: \" + errorContext.getThrowable().getMessage());\n",{"type":51,"tag":85,"props":1402,"children":1404},{"class":87,"line":1403},27,[1405],{"type":51,"tag":85,"props":1406,"children":1407},{},[1408],{"type":57,"value":1409},"        System.err.println(\"Partition: \" + errorContext.getPartitionContext().getPartitionId());\n",{"type":51,"tag":85,"props":1411,"children":1413},{"class":87,"line":1412},28,[1414],{"type":51,"tag":85,"props":1415,"children":1416},{},[1417],{"type":57,"value":1382},{"type":51,"tag":85,"props":1419,"children":1421},{"class":87,"line":1420},29,[1422],{"type":51,"tag":85,"props":1423,"children":1424},{},[1425],{"type":57,"value":1426},"    .buildEventProcessorClient();\n",{"type":51,"tag":85,"props":1428,"children":1430},{"class":87,"line":1429},30,[1431],{"type":51,"tag":85,"props":1432,"children":1433},{"emptyLinePlaceholder":137},[1434],{"type":57,"value":140},{"type":51,"tag":85,"props":1436,"children":1438},{"class":87,"line":1437},31,[1439],{"type":51,"tag":85,"props":1440,"children":1441},{},[1442],{"type":57,"value":1443},"\u002F\u002F Start processing\n",{"type":51,"tag":85,"props":1445,"children":1447},{"class":87,"line":1446},32,[1448],{"type":51,"tag":85,"props":1449,"children":1450},{},[1451],{"type":57,"value":1452},"processor.start();\n",{"type":51,"tag":85,"props":1454,"children":1456},{"class":87,"line":1455},33,[1457],{"type":51,"tag":85,"props":1458,"children":1459},{"emptyLinePlaceholder":137},[1460],{"type":57,"value":140},{"type":51,"tag":85,"props":1462,"children":1464},{"class":87,"line":1463},34,[1465],{"type":51,"tag":85,"props":1466,"children":1467},{},[1468],{"type":57,"value":1469},"\u002F\u002F Keep running...\n",{"type":51,"tag":85,"props":1471,"children":1473},{"class":87,"line":1472},35,[1474],{"type":51,"tag":85,"props":1475,"children":1476},{},[1477],{"type":57,"value":1478},"Thread.sleep(Duration.ofMinutes(5).toMillis());\n",{"type":51,"tag":85,"props":1480,"children":1482},{"class":87,"line":1481},36,[1483],{"type":51,"tag":85,"props":1484,"children":1485},{"emptyLinePlaceholder":137},[1486],{"type":57,"value":140},{"type":51,"tag":85,"props":1488,"children":1490},{"class":87,"line":1489},37,[1491],{"type":51,"tag":85,"props":1492,"children":1493},{},[1494],{"type":57,"value":1495},"\u002F\u002F Stop gracefully\n",{"type":51,"tag":85,"props":1497,"children":1499},{"class":87,"line":1498},38,[1500],{"type":51,"tag":85,"props":1501,"children":1502},{},[1503],{"type":57,"value":1504},"processor.stop();\n",{"type":51,"tag":199,"props":1506,"children":1508},{"id":1507},"batch-processing",[1509],{"type":57,"value":1510},"Batch Processing",{"type":51,"tag":73,"props":1512,"children":1514},{"className":207,"code":1513,"language":18,"meta":78,"style":78},"EventProcessorClient 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",[1515],{"type":51,"tag":81,"props":1516,"children":1517},{"__ignoreMap":78},[1518,1525,1532,1539,1546,1554,1562,1570,1577,1585,1593,1601,1609,1616,1624,1632,1640,1647,1655,1662],{"type":51,"tag":85,"props":1519,"children":1520},{"class":87,"line":88},[1521],{"type":51,"tag":85,"props":1522,"children":1523},{},[1524],{"type":57,"value":1300},{"type":51,"tag":85,"props":1526,"children":1527},{"class":87,"line":97},[1528],{"type":51,"tag":85,"props":1529,"children":1530},{},[1531],{"type":57,"value":259},{"type":51,"tag":85,"props":1533,"children":1534},{"class":87,"line":106},[1535],{"type":51,"tag":85,"props":1536,"children":1537},{},[1538],{"type":57,"value":611},{"type":51,"tag":85,"props":1540,"children":1541},{"class":87,"line":115},[1542],{"type":51,"tag":85,"props":1543,"children":1544},{},[1545],{"type":57,"value":1323},{"type":51,"tag":85,"props":1547,"children":1548},{"class":87,"line":124},[1549],{"type":51,"tag":85,"props":1550,"children":1551},{},[1552],{"type":57,"value":1553},"    .processEventBatch(eventBatchContext -> {\n",{"type":51,"tag":85,"props":1555,"children":1556},{"class":87,"line":133},[1557],{"type":51,"tag":85,"props":1558,"children":1559},{},[1560],{"type":57,"value":1561},"        List\u003CEventData> events = eventBatchContext.getEvents();\n",{"type":51,"tag":85,"props":1563,"children":1564},{"class":87,"line":143},[1565],{"type":51,"tag":85,"props":1566,"children":1567},{},[1568],{"type":57,"value":1569},"        System.out.printf(\"Received %d events%n\", events.size());\n",{"type":51,"tag":85,"props":1571,"children":1572},{"class":87,"line":152},[1573],{"type":51,"tag":85,"props":1574,"children":1575},{},[1576],{"type":57,"value":1355},{"type":51,"tag":85,"props":1578,"children":1579},{"class":87,"line":160},[1580],{"type":51,"tag":85,"props":1581,"children":1582},{},[1583],{"type":57,"value":1584},"        for (EventData event : events) {\n",{"type":51,"tag":85,"props":1586,"children":1587},{"class":87,"line":168},[1588],{"type":51,"tag":85,"props":1589,"children":1590},{},[1591],{"type":57,"value":1592},"            \u002F\u002F Process each event\n",{"type":51,"tag":85,"props":1594,"children":1595},{"class":87,"line":177},[1596],{"type":51,"tag":85,"props":1597,"children":1598},{},[1599],{"type":57,"value":1600},"            System.out.println(event.getBodyAsString());\n",{"type":51,"tag":85,"props":1602,"children":1603},{"class":87,"line":186},[1604],{"type":51,"tag":85,"props":1605,"children":1606},{},[1607],{"type":57,"value":1608},"        }\n",{"type":51,"tag":85,"props":1610,"children":1611},{"class":87,"line":415},[1612],{"type":51,"tag":85,"props":1613,"children":1614},{},[1615],{"type":57,"value":1355},{"type":51,"tag":85,"props":1617,"children":1618},{"class":87,"line":423},[1619],{"type":51,"tag":85,"props":1620,"children":1621},{},[1622],{"type":57,"value":1623},"        \u002F\u002F Checkpoint after batch\n",{"type":51,"tag":85,"props":1625,"children":1626},{"class":87,"line":431},[1627],{"type":51,"tag":85,"props":1628,"children":1629},{},[1630],{"type":57,"value":1631},"        eventBatchContext.updateCheckpoint();\n",{"type":51,"tag":85,"props":1633,"children":1634},{"class":87,"line":440},[1635],{"type":51,"tag":85,"props":1636,"children":1637},{},[1638],{"type":57,"value":1639},"    }, 50) \u002F\u002F maxBatchSize\n",{"type":51,"tag":85,"props":1641,"children":1642},{"class":87,"line":449},[1643],{"type":51,"tag":85,"props":1644,"children":1645},{},[1646],{"type":57,"value":1391},{"type":51,"tag":85,"props":1648,"children":1649},{"class":87,"line":458},[1650],{"type":51,"tag":85,"props":1651,"children":1652},{},[1653],{"type":57,"value":1654},"        System.err.println(\"Error: \" + errorContext.getThrowable());\n",{"type":51,"tag":85,"props":1656,"children":1657},{"class":87,"line":826},[1658],{"type":51,"tag":85,"props":1659,"children":1660},{},[1661],{"type":57,"value":1382},{"type":51,"tag":85,"props":1663,"children":1664},{"class":87,"line":835},[1665],{"type":51,"tag":85,"props":1666,"children":1667},{},[1668],{"type":57,"value":1426},{"type":51,"tag":199,"props":1670,"children":1672},{"id":1671},"async-receiving",[1673],{"type":57,"value":1674},"Async Receiving",{"type":51,"tag":73,"props":1676,"children":1678},{"className":207,"code":1677,"language":18,"meta":78,"style":78},"asyncConsumer.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",[1679],{"type":51,"tag":81,"props":1680,"children":1681},{"__ignoreMap":78},[1682,1690,1698,1706,1714,1722,1730,1738,1746],{"type":51,"tag":85,"props":1683,"children":1684},{"class":87,"line":88},[1685],{"type":51,"tag":85,"props":1686,"children":1687},{},[1688],{"type":57,"value":1689},"asyncConsumer.receiveFromPartition(\"0\", EventPosition.latest())\n",{"type":51,"tag":85,"props":1691,"children":1692},{"class":87,"line":97},[1693],{"type":51,"tag":85,"props":1694,"children":1695},{},[1696],{"type":57,"value":1697},"    .subscribe(\n",{"type":51,"tag":85,"props":1699,"children":1700},{"class":87,"line":106},[1701],{"type":51,"tag":85,"props":1702,"children":1703},{},[1704],{"type":57,"value":1705},"        partitionEvent -> {\n",{"type":51,"tag":85,"props":1707,"children":1708},{"class":87,"line":115},[1709],{"type":51,"tag":85,"props":1710,"children":1711},{},[1712],{"type":57,"value":1713},"            EventData event = partitionEvent.getData();\n",{"type":51,"tag":85,"props":1715,"children":1716},{"class":87,"line":124},[1717],{"type":51,"tag":85,"props":1718,"children":1719},{},[1720],{"type":57,"value":1721},"            System.out.println(\"Received: \" + event.getBodyAsString());\n",{"type":51,"tag":85,"props":1723,"children":1724},{"class":87,"line":133},[1725],{"type":51,"tag":85,"props":1726,"children":1727},{},[1728],{"type":57,"value":1729},"        },\n",{"type":51,"tag":85,"props":1731,"children":1732},{"class":87,"line":143},[1733],{"type":51,"tag":85,"props":1734,"children":1735},{},[1736],{"type":57,"value":1737},"        error -> System.err.println(\"Error: \" + error),\n",{"type":51,"tag":85,"props":1739,"children":1740},{"class":87,"line":152},[1741],{"type":51,"tag":85,"props":1742,"children":1743},{},[1744],{"type":57,"value":1745},"        () -> System.out.println(\"Complete\")\n",{"type":51,"tag":85,"props":1747,"children":1748},{"class":87,"line":160},[1749],{"type":51,"tag":85,"props":1750,"children":1751},{},[1752],{"type":57,"value":1753},"    );\n",{"type":51,"tag":199,"props":1755,"children":1757},{"id":1756},"get-event-hub-properties",[1758],{"type":57,"value":1759},"Get Event Hub Properties",{"type":51,"tag":73,"props":1761,"children":1763},{"className":207,"code":1762,"language":18,"meta":78,"style":78},"\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",[1764],{"type":51,"tag":81,"props":1765,"children":1766},{"__ignoreMap":78},[1767,1775,1783,1791,1799,1806,1814,1822,1830,1838],{"type":51,"tag":85,"props":1768,"children":1769},{"class":87,"line":88},[1770],{"type":51,"tag":85,"props":1771,"children":1772},{},[1773],{"type":57,"value":1774},"\u002F\u002F Get hub info\n",{"type":51,"tag":85,"props":1776,"children":1777},{"class":87,"line":97},[1778],{"type":51,"tag":85,"props":1779,"children":1780},{},[1781],{"type":57,"value":1782},"EventHubProperties hubProps = producer.getEventHubProperties();\n",{"type":51,"tag":85,"props":1784,"children":1785},{"class":87,"line":106},[1786],{"type":51,"tag":85,"props":1787,"children":1788},{},[1789],{"type":57,"value":1790},"System.out.println(\"Hub: \" + hubProps.getName());\n",{"type":51,"tag":85,"props":1792,"children":1793},{"class":87,"line":115},[1794],{"type":51,"tag":85,"props":1795,"children":1796},{},[1797],{"type":57,"value":1798},"System.out.println(\"Partitions: \" + hubProps.getPartitionIds());\n",{"type":51,"tag":85,"props":1800,"children":1801},{"class":87,"line":124},[1802],{"type":51,"tag":85,"props":1803,"children":1804},{"emptyLinePlaceholder":137},[1805],{"type":57,"value":140},{"type":51,"tag":85,"props":1807,"children":1808},{"class":87,"line":133},[1809],{"type":51,"tag":85,"props":1810,"children":1811},{},[1812],{"type":57,"value":1813},"\u002F\u002F Get partition info\n",{"type":51,"tag":85,"props":1815,"children":1816},{"class":87,"line":143},[1817],{"type":51,"tag":85,"props":1818,"children":1819},{},[1820],{"type":57,"value":1821},"PartitionProperties partitionProps = producer.getPartitionProperties(\"0\");\n",{"type":51,"tag":85,"props":1823,"children":1824},{"class":87,"line":152},[1825],{"type":51,"tag":85,"props":1826,"children":1827},{},[1828],{"type":57,"value":1829},"System.out.println(\"Begin sequence: \" + partitionProps.getBeginningSequenceNumber());\n",{"type":51,"tag":85,"props":1831,"children":1832},{"class":87,"line":160},[1833],{"type":51,"tag":85,"props":1834,"children":1835},{},[1836],{"type":57,"value":1837},"System.out.println(\"Last sequence: \" + partitionProps.getLastEnqueuedSequenceNumber());\n",{"type":51,"tag":85,"props":1839,"children":1840},{"class":87,"line":168},[1841],{"type":51,"tag":85,"props":1842,"children":1843},{},[1844],{"type":57,"value":1845},"System.out.println(\"Last offset: \" + partitionProps.getLastEnqueuedOffset());\n",{"type":51,"tag":66,"props":1847,"children":1849},{"id":1848},"event-positions",[1850],{"type":57,"value":1851},"Event Positions",{"type":51,"tag":73,"props":1853,"children":1855},{"className":207,"code":1854,"language":18,"meta":78,"style":78},"\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",[1856],{"type":51,"tag":81,"props":1857,"children":1858},{"__ignoreMap":78},[1859,1867,1875,1882,1890,1898,1905,1913,1921,1928,1936,1944,1951,1959],{"type":51,"tag":85,"props":1860,"children":1861},{"class":87,"line":88},[1862],{"type":51,"tag":85,"props":1863,"children":1864},{},[1865],{"type":57,"value":1866},"\u002F\u002F Start from beginning\n",{"type":51,"tag":85,"props":1868,"children":1869},{"class":87,"line":97},[1870],{"type":51,"tag":85,"props":1871,"children":1872},{},[1873],{"type":57,"value":1874},"EventPosition.earliest()\n",{"type":51,"tag":85,"props":1876,"children":1877},{"class":87,"line":106},[1878],{"type":51,"tag":85,"props":1879,"children":1880},{"emptyLinePlaceholder":137},[1881],{"type":57,"value":140},{"type":51,"tag":85,"props":1883,"children":1884},{"class":87,"line":115},[1885],{"type":51,"tag":85,"props":1886,"children":1887},{},[1888],{"type":57,"value":1889},"\u002F\u002F Start from end (new events only)\n",{"type":51,"tag":85,"props":1891,"children":1892},{"class":87,"line":124},[1893],{"type":51,"tag":85,"props":1894,"children":1895},{},[1896],{"type":57,"value":1897},"EventPosition.latest()\n",{"type":51,"tag":85,"props":1899,"children":1900},{"class":87,"line":133},[1901],{"type":51,"tag":85,"props":1902,"children":1903},{"emptyLinePlaceholder":137},[1904],{"type":57,"value":140},{"type":51,"tag":85,"props":1906,"children":1907},{"class":87,"line":143},[1908],{"type":51,"tag":85,"props":1909,"children":1910},{},[1911],{"type":57,"value":1912},"\u002F\u002F From specific offset\n",{"type":51,"tag":85,"props":1914,"children":1915},{"class":87,"line":152},[1916],{"type":51,"tag":85,"props":1917,"children":1918},{},[1919],{"type":57,"value":1920},"EventPosition.fromOffset(12345L)\n",{"type":51,"tag":85,"props":1922,"children":1923},{"class":87,"line":160},[1924],{"type":51,"tag":85,"props":1925,"children":1926},{"emptyLinePlaceholder":137},[1927],{"type":57,"value":140},{"type":51,"tag":85,"props":1929,"children":1930},{"class":87,"line":168},[1931],{"type":51,"tag":85,"props":1932,"children":1933},{},[1934],{"type":57,"value":1935},"\u002F\u002F From specific sequence number\n",{"type":51,"tag":85,"props":1937,"children":1938},{"class":87,"line":177},[1939],{"type":51,"tag":85,"props":1940,"children":1941},{},[1942],{"type":57,"value":1943},"EventPosition.fromSequenceNumber(100L)\n",{"type":51,"tag":85,"props":1945,"children":1946},{"class":87,"line":186},[1947],{"type":51,"tag":85,"props":1948,"children":1949},{"emptyLinePlaceholder":137},[1950],{"type":57,"value":140},{"type":51,"tag":85,"props":1952,"children":1953},{"class":87,"line":415},[1954],{"type":51,"tag":85,"props":1955,"children":1956},{},[1957],{"type":57,"value":1958},"\u002F\u002F From specific time\n",{"type":51,"tag":85,"props":1960,"children":1961},{"class":87,"line":423},[1962],{"type":51,"tag":85,"props":1963,"children":1964},{},[1965],{"type":57,"value":1966},"EventPosition.fromEnqueuedTime(Instant.now().minus(Duration.ofHours(1)))\n",{"type":51,"tag":66,"props":1968,"children":1970},{"id":1969},"error-handling",[1971],{"type":57,"value":1972},"Error Handling",{"type":51,"tag":73,"props":1974,"children":1976},{"className":207,"code":1975,"language":18,"meta":78,"style":78},"import 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",[1977],{"type":51,"tag":81,"props":1978,"children":1979},{"__ignoreMap":78},[1980,1988,1995,2003,2011,2019,2027,2035,2043,2051,2059,2066,2073,2080,2088],{"type":51,"tag":85,"props":1981,"children":1982},{"class":87,"line":88},[1983],{"type":51,"tag":85,"props":1984,"children":1985},{},[1986],{"type":57,"value":1987},"import com.azure.messaging.eventhubs.models.ErrorContext;\n",{"type":51,"tag":85,"props":1989,"children":1990},{"class":87,"line":97},[1991],{"type":51,"tag":85,"props":1992,"children":1993},{"emptyLinePlaceholder":137},[1994],{"type":57,"value":140},{"type":51,"tag":85,"props":1996,"children":1997},{"class":87,"line":106},[1998],{"type":51,"tag":85,"props":1999,"children":2000},{},[2001],{"type":57,"value":2002},".processError(errorContext -> {\n",{"type":51,"tag":85,"props":2004,"children":2005},{"class":87,"line":115},[2006],{"type":51,"tag":85,"props":2007,"children":2008},{},[2009],{"type":57,"value":2010},"    Throwable error = errorContext.getThrowable();\n",{"type":51,"tag":85,"props":2012,"children":2013},{"class":87,"line":124},[2014],{"type":51,"tag":85,"props":2015,"children":2016},{},[2017],{"type":57,"value":2018},"    String partitionId = errorContext.getPartitionContext().getPartitionId();\n",{"type":51,"tag":85,"props":2020,"children":2021},{"class":87,"line":133},[2022],{"type":51,"tag":85,"props":2023,"children":2024},{},[2025],{"type":57,"value":2026},"    \n",{"type":51,"tag":85,"props":2028,"children":2029},{"class":87,"line":143},[2030],{"type":51,"tag":85,"props":2031,"children":2032},{},[2033],{"type":57,"value":2034},"    if (error instanceof AmqpException) {\n",{"type":51,"tag":85,"props":2036,"children":2037},{"class":87,"line":152},[2038],{"type":51,"tag":85,"props":2039,"children":2040},{},[2041],{"type":57,"value":2042},"        AmqpException amqpError = (AmqpException) error;\n",{"type":51,"tag":85,"props":2044,"children":2045},{"class":87,"line":160},[2046],{"type":51,"tag":85,"props":2047,"children":2048},{},[2049],{"type":57,"value":2050},"        if (amqpError.isTransient()) {\n",{"type":51,"tag":85,"props":2052,"children":2053},{"class":87,"line":168},[2054],{"type":51,"tag":85,"props":2055,"children":2056},{},[2057],{"type":57,"value":2058},"            System.out.println(\"Transient error, will retry\");\n",{"type":51,"tag":85,"props":2060,"children":2061},{"class":87,"line":177},[2062],{"type":51,"tag":85,"props":2063,"children":2064},{},[2065],{"type":57,"value":1608},{"type":51,"tag":85,"props":2067,"children":2068},{"class":87,"line":186},[2069],{"type":51,"tag":85,"props":2070,"children":2071},{},[2072],{"type":57,"value":800},{"type":51,"tag":85,"props":2074,"children":2075},{"class":87,"line":415},[2076],{"type":51,"tag":85,"props":2077,"children":2078},{},[2079],{"type":57,"value":2026},{"type":51,"tag":85,"props":2081,"children":2082},{"class":87,"line":423},[2083],{"type":51,"tag":85,"props":2084,"children":2085},{},[2086],{"type":57,"value":2087},"    System.err.printf(\"Error on partition %s: %s%n\", partitionId, error.getMessage());\n",{"type":51,"tag":85,"props":2089,"children":2090},{"class":87,"line":431},[2091],{"type":51,"tag":85,"props":2092,"children":2093},{},[2094],{"type":57,"value":2095},"})\n",{"type":51,"tag":66,"props":2097,"children":2099},{"id":2098},"resource-cleanup",[2100],{"type":57,"value":2101},"Resource Cleanup",{"type":51,"tag":73,"props":2103,"children":2105},{"className":207,"code":2104,"language":18,"meta":78,"style":78},"\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",[2106],{"type":51,"tag":81,"props":2107,"children":2108},{"__ignoreMap":78},[2109,2117,2125,2132,2140,2148,2155,2162,2170,2178,2186,2194,2202],{"type":51,"tag":85,"props":2110,"children":2111},{"class":87,"line":88},[2112],{"type":51,"tag":85,"props":2113,"children":2114},{},[2115],{"type":57,"value":2116},"\u002F\u002F Always close clients\n",{"type":51,"tag":85,"props":2118,"children":2119},{"class":87,"line":97},[2120],{"type":51,"tag":85,"props":2121,"children":2122},{},[2123],{"type":57,"value":2124},"try {\n",{"type":51,"tag":85,"props":2126,"children":2127},{"class":87,"line":106},[2128],{"type":51,"tag":85,"props":2129,"children":2130},{},[2131],{"type":57,"value":841},{"type":51,"tag":85,"props":2133,"children":2134},{"class":87,"line":115},[2135],{"type":51,"tag":85,"props":2136,"children":2137},{},[2138],{"type":57,"value":2139},"} finally {\n",{"type":51,"tag":85,"props":2141,"children":2142},{"class":87,"line":124},[2143],{"type":51,"tag":85,"props":2144,"children":2145},{},[2146],{"type":57,"value":2147},"    producer.close();\n",{"type":51,"tag":85,"props":2149,"children":2150},{"class":87,"line":133},[2151],{"type":51,"tag":85,"props":2152,"children":2153},{},[2154],{"type":57,"value":808},{"type":51,"tag":85,"props":2156,"children":2157},{"class":87,"line":143},[2158],{"type":51,"tag":85,"props":2159,"children":2160},{"emptyLinePlaceholder":137},[2161],{"type":57,"value":140},{"type":51,"tag":85,"props":2163,"children":2164},{"class":87,"line":152},[2165],{"type":51,"tag":85,"props":2166,"children":2167},{},[2168],{"type":57,"value":2169},"\u002F\u002F Or use try-with-resources\n",{"type":51,"tag":85,"props":2171,"children":2172},{"class":87,"line":160},[2173],{"type":51,"tag":85,"props":2174,"children":2175},{},[2176],{"type":57,"value":2177},"try (EventHubProducerClient producer = new EventHubClientBuilder()\n",{"type":51,"tag":85,"props":2179,"children":2180},{"class":87,"line":168},[2181],{"type":51,"tag":85,"props":2182,"children":2183},{},[2184],{"type":57,"value":2185},"        .connectionString(connectionString, eventHubName)\n",{"type":51,"tag":85,"props":2187,"children":2188},{"class":87,"line":177},[2189],{"type":51,"tag":85,"props":2190,"children":2191},{},[2192],{"type":57,"value":2193},"        .buildProducerClient()) {\n",{"type":51,"tag":85,"props":2195,"children":2196},{"class":87,"line":186},[2197],{"type":51,"tag":85,"props":2198,"children":2199},{},[2200],{"type":57,"value":2201},"    producer.send(events);\n",{"type":51,"tag":85,"props":2203,"children":2204},{"class":87,"line":415},[2205],{"type":51,"tag":85,"props":2206,"children":2207},{},[2208],{"type":57,"value":808},{"type":51,"tag":66,"props":2210,"children":2212},{"id":2211},"environment-variables",[2213],{"type":57,"value":2214},"Environment Variables",{"type":51,"tag":73,"props":2216,"children":2220},{"className":2217,"code":2218,"language":2219,"meta":78,"style":78},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","EVENT_HUBS_CONNECTION_STRING=Endpoint=sb:\u002F\u002F\u003Cnamespace>.servicebus.windows.net\u002F;SharedAccessKeyName=...  # Alternative to Entra ID auth\nEVENT_HUBS_NAME=\u003Cevent-hub-name>  # Required for event hub name\nSTORAGE_CONNECTION_STRING=\u003Cfor-checkpointing>  # Alternative to Entra ID auth for checkpointing\nAZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production\n","bash",[2221],{"type":51,"tag":81,"props":2222,"children":2223},{"__ignoreMap":78},[2224,2299,2326,2352],{"type":51,"tag":85,"props":2225,"children":2226},{"class":87,"line":88},[2227,2233,2239,2244,2248,2254,2259,2264,2269,2274,2279,2284,2288,2293],{"type":51,"tag":85,"props":2228,"children":2230},{"style":2229},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[2231],{"type":57,"value":2232},"EVENT_HUBS_CONNECTION_STRING",{"type":51,"tag":85,"props":2234,"children":2236},{"style":2235},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[2237],{"type":57,"value":2238},"=",{"type":51,"tag":85,"props":2240,"children":2241},{"style":2229},[2242],{"type":57,"value":2243},"Endpoint",{"type":51,"tag":85,"props":2245,"children":2246},{"style":2235},[2247],{"type":57,"value":2238},{"type":51,"tag":85,"props":2249,"children":2251},{"style":2250},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[2252],{"type":57,"value":2253},"sb:\u002F\u002F",{"type":51,"tag":85,"props":2255,"children":2256},{"style":2235},[2257],{"type":57,"value":2258},"\u003C",{"type":51,"tag":85,"props":2260,"children":2261},{"style":2250},[2262],{"type":57,"value":2263},"namespace",{"type":51,"tag":85,"props":2265,"children":2266},{"style":2235},[2267],{"type":57,"value":2268},">",{"type":51,"tag":85,"props":2270,"children":2271},{"style":2250},[2272],{"type":57,"value":2273},".servicebus.windows.net\u002F",{"type":51,"tag":85,"props":2275,"children":2276},{"style":2235},[2277],{"type":57,"value":2278},";",{"type":51,"tag":85,"props":2280,"children":2281},{"style":2229},[2282],{"type":57,"value":2283},"SharedAccessKeyName",{"type":51,"tag":85,"props":2285,"children":2286},{"style":2235},[2287],{"type":57,"value":2238},{"type":51,"tag":85,"props":2289,"children":2290},{"style":2250},[2291],{"type":57,"value":2292},"...",{"type":51,"tag":85,"props":2294,"children":2296},{"style":2295},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[2297],{"type":57,"value":2298},"  # Alternative to Entra ID auth\n",{"type":51,"tag":85,"props":2300,"children":2301},{"class":87,"line":97},[2302,2307,2312,2317,2321],{"type":51,"tag":85,"props":2303,"children":2304},{"style":2229},[2305],{"type":57,"value":2306},"EVENT_HUBS_NAME",{"type":51,"tag":85,"props":2308,"children":2309},{"style":2235},[2310],{"type":57,"value":2311},"=\u003C",{"type":51,"tag":85,"props":2313,"children":2314},{"style":2250},[2315],{"type":57,"value":2316},"event-hub-name",{"type":51,"tag":85,"props":2318,"children":2319},{"style":2235},[2320],{"type":57,"value":2268},{"type":51,"tag":85,"props":2322,"children":2323},{"style":2295},[2324],{"type":57,"value":2325},"  # Required for event hub name\n",{"type":51,"tag":85,"props":2327,"children":2328},{"class":87,"line":106},[2329,2334,2338,2343,2347],{"type":51,"tag":85,"props":2330,"children":2331},{"style":2229},[2332],{"type":57,"value":2333},"STORAGE_CONNECTION_STRING",{"type":51,"tag":85,"props":2335,"children":2336},{"style":2235},[2337],{"type":57,"value":2311},{"type":51,"tag":85,"props":2339,"children":2340},{"style":2250},[2341],{"type":57,"value":2342},"for-checkpointing",{"type":51,"tag":85,"props":2344,"children":2345},{"style":2235},[2346],{"type":57,"value":2268},{"type":51,"tag":85,"props":2348,"children":2349},{"style":2295},[2350],{"type":57,"value":2351},"  # Alternative to Entra ID auth for checkpointing\n",{"type":51,"tag":85,"props":2353,"children":2354},{"class":87,"line":115},[2355,2360,2364,2369],{"type":51,"tag":85,"props":2356,"children":2357},{"style":2229},[2358],{"type":57,"value":2359},"AZURE_TOKEN_CREDENTIALS",{"type":51,"tag":85,"props":2361,"children":2362},{"style":2235},[2363],{"type":57,"value":2238},{"type":51,"tag":85,"props":2365,"children":2366},{"style":2250},[2367],{"type":57,"value":2368},"prod",{"type":51,"tag":85,"props":2370,"children":2371},{"style":2295},[2372],{"type":57,"value":2373},"  # Required only if DefaultAzureCredential is used in production\n",{"type":51,"tag":66,"props":2375,"children":2377},{"id":2376},"best-practices",[2378],{"type":57,"value":2379},"Best Practices",{"type":51,"tag":2381,"props":2382,"children":2383},"ol",{},[2384,2396,2414,2424,2434,2443],{"type":51,"tag":2385,"props":2386,"children":2387},"li",{},[2388,2394],{"type":51,"tag":2389,"props":2390,"children":2391},"strong",{},[2392],{"type":57,"value":2393},"Use EventProcessorClient",{"type":57,"value":2395},": For production, provides load balancing and checkpointing",{"type":51,"tag":2385,"props":2397,"children":2398},{},[2399,2404,2406,2412],{"type":51,"tag":2389,"props":2400,"children":2401},{},[2402],{"type":57,"value":2403},"Batch Events",{"type":57,"value":2405},": Use ",{"type":51,"tag":81,"props":2407,"children":2409},{"className":2408},[],[2410],{"type":57,"value":2411},"EventDataBatch",{"type":57,"value":2413}," for efficient sending",{"type":51,"tag":2385,"props":2415,"children":2416},{},[2417,2422],{"type":51,"tag":2389,"props":2418,"children":2419},{},[2420],{"type":57,"value":2421},"Partition Keys",{"type":57,"value":2423},": Use for ordering guarantees within a partition",{"type":51,"tag":2385,"props":2425,"children":2426},{},[2427,2432],{"type":51,"tag":2389,"props":2428,"children":2429},{},[2430],{"type":57,"value":2431},"Checkpointing",{"type":57,"value":2433},": Checkpoint after processing to avoid reprocessing",{"type":51,"tag":2385,"props":2435,"children":2436},{},[2437,2441],{"type":51,"tag":2389,"props":2438,"children":2439},{},[2440],{"type":57,"value":1972},{"type":57,"value":2442},": Handle transient errors with retries",{"type":51,"tag":2385,"props":2444,"children":2445},{},[2446,2451],{"type":51,"tag":2389,"props":2447,"children":2448},{},[2449],{"type":57,"value":2450},"Close Clients",{"type":57,"value":2452},": Always close producer\u002Fconsumer when done",{"type":51,"tag":66,"props":2454,"children":2456},{"id":2455},"trigger-phrases",[2457],{"type":57,"value":2458},"Trigger Phrases",{"type":51,"tag":2460,"props":2461,"children":2462},"ul",{},[2463,2468,2473,2478,2483,2488],{"type":51,"tag":2385,"props":2464,"children":2465},{},[2466],{"type":57,"value":2467},"\"Event Hubs Java\"",{"type":51,"tag":2385,"props":2469,"children":2470},{},[2471],{"type":57,"value":2472},"\"event streaming Azure\"",{"type":51,"tag":2385,"props":2474,"children":2475},{},[2476],{"type":57,"value":2477},"\"real-time data ingestion\"",{"type":51,"tag":2385,"props":2479,"children":2480},{},[2481],{"type":57,"value":2482},"\"EventProcessorClient\"",{"type":51,"tag":2385,"props":2484,"children":2485},{},[2486],{"type":57,"value":2487},"\"event hub producer consumer\"",{"type":51,"tag":2385,"props":2489,"children":2490},{},[2491],{"type":57,"value":2492},"\"partition processing\"",{"type":51,"tag":2494,"props":2495,"children":2496},"style",{},[2497],{"type":57,"value":2498},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2500,"total":1498},[2501,2517,2536,2551,2568,2579,2592],{"slug":2502,"name":2502,"fn":2503,"description":2504,"org":2505,"tags":2506,"stars":25,"repoUrl":26,"updatedAt":2516},"azure-ai-agents-persistent-dotnet","build AI agents with Azure .NET SDK","Azure AI Agents Persistent SDK for .NET. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools. Use for agent CRUD, conversation threads, streaming responses, function calling, file search, and code interpreter. Triggers: \"PersistentAgentsClient\", \"persistent agents\", \"agent threads\", \"agent runs\", \"streaming agents\", \"function calling agents .NET\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2507,2510,2512,2513],{"name":2508,"slug":2509,"type":15},".NET","net",{"name":2511,"slug":32,"type":15},"Agents",{"name":13,"slug":14,"type":15},{"name":2514,"slug":2515,"type":15},"LLM","llm","2026-07-03T16:32:10.297433",{"slug":2518,"name":2518,"fn":2519,"description":2520,"org":2521,"tags":2522,"stars":25,"repoUrl":26,"updatedAt":2535},"azure-ai-anomalydetector-java","build anomaly detection applications with Java","Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate\u002Fmultivariate anomaly detection, time-series analysis, or AI-powered monitoring.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2523,2526,2527,2530,2531,2532],{"name":2524,"slug":2525,"type":15},"Analytics","analytics",{"name":13,"slug":14,"type":15},{"name":2528,"slug":2529,"type":15},"Data Analysis","data-analysis",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2533,"slug":2534,"type":15},"Monitoring","monitoring","2026-05-13T06:14:16.261754",{"slug":2537,"name":2537,"fn":2538,"description":2539,"org":2540,"tags":2541,"stars":25,"repoUrl":26,"updatedAt":2550},"azure-ai-contentsafety-java","build content moderation applications with Azure AI","Build content moderation applications with Azure AI Content Safety SDK for Java. Use when implementing text\u002Fimage analysis, blocklist management, or harm detection for hate, violence, sexual content, and self-harm.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2542,2545,2546,2547],{"name":2543,"slug":2544,"type":15},"AI Infrastructure","ai-infrastructure",{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":2548,"slug":2549,"type":15},"Security","security","2026-07-07T06:53:31.293235",{"slug":2552,"name":2552,"fn":2553,"description":2554,"org":2555,"tags":2556,"stars":25,"repoUrl":26,"updatedAt":2567},"azure-ai-contentsafety-py","detect harmful content with Azure AI Content Safety","Azure AI Content Safety SDK for Python. Use for detecting harmful content in text and images with multi-severity classification.\nTriggers: \"azure-ai-contentsafety\", \"ContentSafetyClient\", \"content moderation\", \"harmful content\", \"text analysis\", \"image analysis\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2557,2558,2561,2562,2563,2566],{"name":13,"slug":14,"type":15},{"name":2559,"slug":2560,"type":15},"Compliance","compliance",{"name":2514,"slug":2515,"type":15},{"name":9,"slug":8,"type":15},{"name":2564,"slug":2565,"type":15},"Python","python",{"name":2548,"slug":2549,"type":15},"2026-07-18T05:14:23.017504",{"slug":2569,"name":2569,"fn":2570,"description":2571,"org":2572,"tags":2573,"stars":25,"repoUrl":26,"updatedAt":2578},"azure-ai-language-conversations-py","implement conversational language understanding with Python","Implement Conversational Language Understanding (CLU) using the azure-ai-language-conversations Python SDK. Use when working with ConversationAnalysisClient to analyze conversation intent and entities, building NLP features, or integrating language understanding into applications.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2574,2575,2576,2577],{"name":2524,"slug":2525,"type":15},{"name":13,"slug":14,"type":15},{"name":2514,"slug":2515,"type":15},{"name":2564,"slug":2565,"type":15},"2026-07-31T05:54:29.068751",{"slug":2580,"name":2580,"fn":2581,"description":2582,"org":2583,"tags":2584,"stars":25,"repoUrl":26,"updatedAt":2591},"azure-ai-translation-text-py","translate text using Azure AI services","Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup. Use for translating text content in applications.\nTriggers: \"text translation\", \"translator\", \"translate text\", \"transliterate\", \"TextTranslationClient\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2585,2588,2589,2590],{"name":2586,"slug":2587,"type":15},"API Development","api-development",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":2564,"slug":2565,"type":15},"2026-07-18T05:14:16.988376",{"slug":2593,"name":2593,"fn":2594,"description":2595,"org":2596,"tags":2597,"stars":25,"repoUrl":26,"updatedAt":2606},"azure-ai-vision-imageanalysis-py","analyze images with Azure AI Vision","Azure AI Vision Image Analysis SDK for captions, tags, objects, OCR, people detection, and smart cropping. Use for computer vision and image understanding tasks.\nTriggers: \"image analysis\", \"computer vision\", \"OCR\", \"object detection\", \"ImageAnalysisClient\", \"image caption\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2598,2599,2602,2605],{"name":13,"slug":14,"type":15},{"name":2600,"slug":2601,"type":15},"Computer Vision","computer-vision",{"name":2603,"slug":2604,"type":15},"Images","images",{"name":2564,"slug":2565,"type":15},"2026-07-18T05:14:18.007737",{"items":2608,"total":2743},[2609,2631,2638,2647,2654,2663,2670,2677,2684,2699,2718,2731],{"slug":2610,"name":2610,"fn":2611,"description":2612,"org":2613,"tags":2614,"stars":2628,"repoUrl":2629,"updatedAt":2630},"rushstack-best-practices","manage Rush monorepos with best practices","Provides best practices and guidance for working with Rush monorepos. Use when the user is working in a Rush-based repository, asks about Rush commands (install, update, build, rebuild), needs help with project selection, dependency management, build caching, subspace configuration, or troubleshooting Rush-specific issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2615,2618,2621,2622,2625],{"name":2616,"slug":2617,"type":15},"Engineering","engineering",{"name":2619,"slug":2620,"type":15},"Local Development","local-development",{"name":9,"slug":8,"type":15},{"name":2623,"slug":2624,"type":15},"Project Management","project-management",{"name":2626,"slug":2627,"type":15},"Rush","rush",6484,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Frushstack","2026-04-06T18:34:44.965032",{"slug":2502,"name":2502,"fn":2503,"description":2504,"org":2632,"tags":2633,"stars":25,"repoUrl":26,"updatedAt":2516},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2634,2635,2636,2637],{"name":2508,"slug":2509,"type":15},{"name":2511,"slug":32,"type":15},{"name":13,"slug":14,"type":15},{"name":2514,"slug":2515,"type":15},{"slug":2518,"name":2518,"fn":2519,"description":2520,"org":2639,"tags":2640,"stars":25,"repoUrl":26,"updatedAt":2535},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2641,2642,2643,2644,2645,2646],{"name":2524,"slug":2525,"type":15},{"name":13,"slug":14,"type":15},{"name":2528,"slug":2529,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2533,"slug":2534,"type":15},{"slug":2537,"name":2537,"fn":2538,"description":2539,"org":2648,"tags":2649,"stars":25,"repoUrl":26,"updatedAt":2550},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2650,2651,2652,2653],{"name":2543,"slug":2544,"type":15},{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":2548,"slug":2549,"type":15},{"slug":2552,"name":2552,"fn":2553,"description":2554,"org":2655,"tags":2656,"stars":25,"repoUrl":26,"updatedAt":2567},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2657,2658,2659,2660,2661,2662],{"name":13,"slug":14,"type":15},{"name":2559,"slug":2560,"type":15},{"name":2514,"slug":2515,"type":15},{"name":9,"slug":8,"type":15},{"name":2564,"slug":2565,"type":15},{"name":2548,"slug":2549,"type":15},{"slug":2569,"name":2569,"fn":2570,"description":2571,"org":2664,"tags":2665,"stars":25,"repoUrl":26,"updatedAt":2578},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2666,2667,2668,2669],{"name":2524,"slug":2525,"type":15},{"name":13,"slug":14,"type":15},{"name":2514,"slug":2515,"type":15},{"name":2564,"slug":2565,"type":15},{"slug":2580,"name":2580,"fn":2581,"description":2582,"org":2671,"tags":2672,"stars":25,"repoUrl":26,"updatedAt":2591},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2673,2674,2675,2676],{"name":2586,"slug":2587,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":2564,"slug":2565,"type":15},{"slug":2593,"name":2593,"fn":2594,"description":2595,"org":2678,"tags":2679,"stars":25,"repoUrl":26,"updatedAt":2606},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2680,2681,2682,2683],{"name":13,"slug":14,"type":15},{"name":2600,"slug":2601,"type":15},{"name":2603,"slug":2604,"type":15},{"name":2564,"slug":2565,"type":15},{"slug":2685,"name":2685,"fn":2686,"description":2687,"org":2688,"tags":2689,"stars":25,"repoUrl":26,"updatedAt":2698},"azure-appconfiguration-java","manage configuration with Azure App Configuration","Azure App Configuration SDK for Java. Centralized application configuration management with key-value settings, feature flags, and snapshots.\nTriggers: \"ConfigurationClient java\", \"app configuration java\", \"feature flag java\", \"configuration setting java\", \"azure config java\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2690,2691,2694,2697],{"name":13,"slug":14,"type":15},{"name":2692,"slug":2693,"type":15},"Configuration","configuration",{"name":2695,"slug":2696,"type":15},"Feature Flags","feature-flags",{"name":17,"slug":18,"type":15},"2026-07-03T16:32:01.278468",{"slug":2700,"name":2700,"fn":2701,"description":2702,"org":2703,"tags":2704,"stars":25,"repoUrl":26,"updatedAt":2717},"azure-cosmos-rust","build applications with Azure Cosmos DB","Azure Cosmos DB library for Rust (NoSQL API). Document CRUD, containers, and globally distributed data.\nTriggers: \"cosmos db rust\", \"CosmosClient rust\", \"document crud rust\", \"NoSQL rust\", \"partition key rust\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2705,2708,2711,2714],{"name":2706,"slug":2707,"type":15},"Cosmos DB","cosmos-db",{"name":2709,"slug":2710,"type":15},"Database","database",{"name":2712,"slug":2713,"type":15},"NoSQL","nosql",{"name":2715,"slug":2716,"type":15},"Rust","rust","2026-07-31T05:54:27.021432",{"slug":2719,"name":2719,"fn":2701,"description":2720,"org":2721,"tags":2722,"stars":25,"repoUrl":26,"updatedAt":2730},"azure-cosmos-ts","Azure Cosmos DB JavaScript\u002FTypeScript SDK (@azure\u002Fcosmos) for data plane operations. Use for CRUD operations on documents, queries, bulk operations, and container management. Triggers: \"Cosmos DB\", \"@azure\u002Fcosmos\", \"CosmosClient\", \"document CRUD\", \"NoSQL queries\", \"bulk operations\", \"partition key\", \"container.items\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2723,2724,2725,2726,2727],{"name":2706,"slug":2707,"type":15},{"name":2709,"slug":2710,"type":15},{"name":9,"slug":8,"type":15},{"name":2712,"slug":2713,"type":15},{"name":2728,"slug":2729,"type":15},"TypeScript","typescript","2026-07-03T16:31:19.368382",{"slug":2732,"name":2732,"fn":2733,"description":2734,"org":2735,"tags":2736,"stars":25,"repoUrl":26,"updatedAt":2742},"azure-data-tables-java","build table storage applications with Java","Build table storage applications with Azure Tables SDK for Java. Use when working with Azure Table Storage or Cosmos DB Table API for NoSQL key-value data, schemaless storage, or structured data at scale.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2737,2738,2739,2740,2741],{"name":13,"slug":14,"type":15},{"name":2706,"slug":2707,"type":15},{"name":2709,"slug":2710,"type":15},{"name":17,"slug":18,"type":15},{"name":2712,"slug":2713,"type":15},"2026-05-13T06:14:17.582229",267]