![]() |
VOOZH | about |
dotnet add package Franz.Common.Annotations --version 2.2.7
NuGet\Install-Package Franz.Common.Annotations -Version 2.2.7
<PackageReference Include="Franz.Common.Annotations" Version="2.2.7" />
<PackageVersion Include="Franz.Common.Annotations" Version="2.2.7" />Directory.Packages.props
<PackageReference Include="Franz.Common.Annotations" />Project file
paket add Franz.Common.Annotations --version 2.2.7
#r "nuget: Franz.Common.Annotations, 2.2.7"
#:package Franz.Common.Annotations@2.2.7
#addin nuget:?package=Franz.Common.Annotations&version=2.2.7Install as a Cake Addin
#tool nuget:?package=Franz.Common.Annotations&version=2.2.7Install as a Cake Tool
A lightweight library within the Franz Framework designed to provide custom attribute-based annotations for simplifying Kafka topic validation in .NET applications.
RequiredKafkaTopicAttribute: Ensures that a Kafka topic is specified and validated for producer/consumer configurations.-Current Version: v2.2.7
Since this package is hosted privately, configure your NuGet client:
dotnet nuget add source "https://your-private-feed-url" \
--name "AzurePrivateFeed" \
--username "YourAzureUsername" \
--password "YourAzurePassword" \
--store-password-in-clear-text
Install the package:
dotnet add package Franz.Common.Annotations
RequiredKafkaTopicAttributeUse the RequiredKafkaTopicAttribute to annotate properties or fields that represent Kafka topics in your application. This ensures that all required topics are explicitly defined and validated at runtime.
Example:
using Franz.Common.Annotations;
public class KafkaConfiguration
{
[RequiredKafkaTopic]
public string OrdersTopic { get; set; }
[RequiredKafkaTopic]
public string PaymentsTopic { get; set; }
}
Ensure that annotated properties are checked during application initialization:
var kafkaConfig = new KafkaConfiguration
{
OrdersTopic = "orders",
PaymentsTopic = string.Empty // Validation will fail here
};
ValidateKafkaConfiguration(kafkaConfig);
void ValidateKafkaConfiguration(object config)
{
var properties = config.GetType().GetProperties();
foreach (var property in properties)
{
var attribute = property.GetCustomAttribute<RequiredKafkaTopicAttribute>();
if (attribute != null && string.IsNullOrWhiteSpace(property.GetValue(config)?.ToString()))
{
throw new InvalidOperationException($"The Kafka topic '{property.Name}' is required but was not provided.");
}
}
}
This package has no external dependencies but integrates seamlessly with other Franz Framework libraries.
This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:
This library is licensed under the MIT License. See the LICENSE file for more details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Franz.Common.Annotations:
| Package | Downloads |
|---|---|
|
Franz.Common.Messaging.Kafka
Shared utility library for the Franz Framework. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.7 | 127 | 6/7/2026 |
| 2.2.6 | 128 | 6/6/2026 |
| 2.2.5 | 131 | 6/4/2026 |
| 2.2.4 | 119 | 6/3/2026 |
| 2.2.3 | 145 | 6/2/2026 |
| 2.2.2 | 143 | 6/2/2026 |
| 2.2.1 | 147 | 5/24/2026 |
| 2.1.4 | 138 | 4/27/2026 |
| 2.1.3 | 135 | 4/26/2026 |
| 2.1.2 | 134 | 4/26/2026 |
| 2.1.1 | 138 | 4/22/2026 |
| 2.0.2 | 153 | 3/30/2026 |
| 2.0.1 | 148 | 3/29/2026 |
| 1.7.8 | 149 | 3/2/2026 |
| 1.7.7 | 159 | 1/31/2026 |
| 1.7.6 | 162 | 1/22/2026 |
| 1.7.5 | 160 | 1/10/2026 |
| 1.7.4 | 153 | 12/27/2025 |
| 1.7.3 | 250 | 12/22/2025 |
| 1.7.2 | 234 | 12/21/2025 |