Skip to content

lupusbytes/event-hub-live-explorer

Repository files navigation

Event Hub Live Explorer

Event Hub Live Explorer is a Blazor-based frontend for interacting with Azure Event Hubs. It provides a streamlined interface for both sending and receiving events in real time, making it a valuable tool for local development, testing, and diagnostics.

Built with .NET Aspire in mind, it integrates smoothly into Aspire dashboards and enhances the developer experience when working with event-driven systems.


✨ Features

  • 📤 Send messages directly to Event Hubs
  • 📥 Read events from multiple partitions in real time
  • 🛠️ Integrates with .NET Aspire
  • 🧪 Ideal for local development and testing of event-based systems

📷 Screenshot

Event Hub Live Explorer example screenshot

🚀 Getting Started

🧩 Usage in Aspire

Prerequisites

Install NuGet package LupusBytes.Aspire.Hosting.Azure.EventHubs.LiveExplorer in your Aspire AppHost project.

dotnet add package LupusBytes.Aspire.Hosting.Azure.EventHubs.LiveExplorer

Add Event Hub Live Explorer to your Aspire Dashboard

var explorer = builder.AddAzureEventHubsLiveExplorer();

Reference an Event Hub

var eventHub = builder
   .AddAzureEventHubs("event-hub-namespace").RunAsEmulator()
   .AddHub("event-hub");

explorer.WithReference(eventHub);

This makes the Event Hub Live Explorer connect to the Event Hub, using the $Default consumer group.

Use a different consumer group

var eventHubWithCustomConsumerGroup = eventHub.AddConsumerGroup("explorer");
explorer.WithReference(eventHubWithCustomConsumerGroup)

Add all Event Hubs automatically

To reduce boilerplate, a convenience method exists to reference all Event Hubs and create consumer groups on them (if they don’t already exist):

builder
   .AddAzureEventHubs("event-hub-namespace").RunAsEmulator()
   .AddEventHub("event-hub1")
   .AddEventHub("event-hub2")
   .AddEventHub("event-hub3")
   .AddEventHub("event-hub4");

explorer.WithAutoReferences(consumerGroupName: "explorer");

This will scan the application model for Azure Event Hub resources and add them as references using the provided consumer group.

⚠️ This method must be called after every desired Azure Event Hub has already been added to the application model. Azure Event Hubs added after invocation of this method will not be referenced!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •