CasCap.Api.Azure.EventHub 2.0.0

Prefix Reserved
dotnet add package CasCap.Api.Azure.EventHub --version 2.0.0
                    
NuGet\Install-Package CasCap.Api.Azure.EventHub -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CasCap.Api.Azure.EventHub" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CasCap.Api.Azure.EventHub" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CasCap.Api.Azure.EventHub" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CasCap.Api.Azure.EventHub --version 2.0.0
                    
#r "nuget: CasCap.Api.Azure.EventHub, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CasCap.Api.Azure.EventHub@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CasCap.Api.Azure.EventHub&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CasCap.Api.Azure.EventHub&version=2.0.0
                    
Install as a Cake Tool

CasCap.Api.Azure.EventHub

Generic Azure Event Hubs base services for .NET applications. PublisherService<T> implements IPublisherService<T> and serializes values with MessagePack; SubscriberService<T> implements ISubscriberService<T> and receives and deserializes values using blob checkpoints.

Installation

Targets net8.0, net9.0 and net10.0.

dotnet add package CasCap.Api.Azure.EventHub

Publishing

Derive a concrete publisher and supply an Event Hubs namespace, hub name and token credential:

using Azure.Core;
using CasCap.Services;

public sealed class TextPublisher(
    string fullyQualifiedNamespace, string eventHubName, TokenCredential credential)
    : PublisherService<string>(fullyQualifiedNamespace, eventHubName, credential)
{
}
var publisher = new TextPublisher(namespaceName, eventHubName, credential);
await publisher.Push("example");

Push(T) and Push(List<T>) use MessagePack; Push(byte[]) and Push(List<byte[]>) send raw payloads. Use matching serialization on the receiver. IEvent exists but is not a generic constraint. The publisher creates one SDK batch per call and throws when a payload collection cannot fit; it does not split oversized collections automatically.

The connection-string constructor accepts entityPath, but the implementation constructs its SDK client from the connection string alone. Include the hub's EntityPath in that string, or prefer the token-credential overload with an explicit hub name.

Receiving and Limitations

SubscriberService<T> takes an event hub name, Event Hubs connection string, storage connection string and checkpoint-container name. Its credential overload additionally takes the namespace and TokenCredential, but still requires nonblank connection-string arguments and still uses the storage connection string for checkpoints.

InitiateReceive(cancellationToken) creates the checkpoint container if needed and runs until cancelled, using the default consumer group. The implementation logs each event's partition and size at Debug, never its contents, and updates checkpoints periodically. Its event/error handlers are private: there is no overridable application-processing callback or message event. Use the Azure SDK directly when application work must run before a checkpoint is committed.

The receiver catches outer processing exceptions; returning from InitiateReceive is not proof of successful processing; a handler exception is logged once as an Error. Send failures propagate to the caller without being logged by the publisher. Neither base class exposes SDK-client disposal through a public disposal contract.

Authentication and Configuration

Provision the hub and checkpoint storage. Grant publisher send permissions, receiver listen permissions and checkpoint-storage read/write permissions as needed. Keep connection strings in a secret provider. There is no options model or automatic DI registration.

Documentation

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 51 11/5/2026
1.8.0 102 11/1/2026
1.7.1 104 10/24/2026
1.7.0 103 10/21/2026
1.6.4 95 10/4/2026
1.6.3 114 9/25/2026
1.6.2 114 9/23/2026
1.6.1 123 9/21/2026
1.6.0 110 9/19/2026
1.5.5 120 9/11/2026
1.5.4 118 9/1/2026
1.5.3 131 8/18/2026
1.5.2 147 7/15/2026
1.5.1 170 6/26/2026
1.5.0 145 6/12/2026
1.4.13 145 6/10/2026
1.4.12 145 5/27/2026
1.4.11 141 5/26/2026
1.4.10 138 5/21/2026
1.4.9 132 5/20/2026
Loading failed