Franz.Common.Messaging.MassTransit
1.2.62
See the version list below for details.
dotnet add package Franz.Common.Messaging.MassTransit --version 1.2.62
NuGet\Install-Package Franz.Common.Messaging.MassTransit -Version 1.2.62
<PackageReference Include="Franz.Common.Messaging.MassTransit" Version="1.2.62" />
paket add Franz.Common.Messaging.MassTransit --version 1.2.62
#r "nuget: Franz.Common.Messaging.MassTransit, 1.2.62"
// Install Franz.Common.Messaging.MassTransit as a Cake Addin #addin nuget:?package=Franz.Common.Messaging.MassTransit&version=1.2.62 // Install Franz.Common.Messaging.MassTransit as a Cake Tool #tool nuget:?package=Franz.Common.Messaging.MassTransit&version=1.2.62
Franz.Common.Messaging.MassTransit
A library within the Franz Framework that integrates MassTransit with messaging workflows. This package simplifies the setup and management of Kafka-based messaging using MassTransit, providing tools for producers, consumers, and client registrations.
Features
- MassTransit Integration:
- Extends MassTransit functionality to Kafka-based workflows.
- Kafka Messaging:
- Interfaces for Kafka producers (
IKafkaProducer
) and consumers (IKafkaConsumer
).
- Interfaces for Kafka producers (
- Messaging Client:
IMessagingClient
for abstracting and managing messaging operations.
- Service Registration:
ServiceRegistration
to streamline the setup of Kafka producers and consumers.
Version Information
- Current Version: 1.2.62
- Part of the private Franz Framework ecosystem.
Dependencies
This package relies on:
- MassTransit (8.3.4): Provides in-process messaging and event-driven architecture tools.
- MassTransit.Kafka (8.3.4): Adds Kafka transport support for MassTransit.
Installation
From Private Azure Feed
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.Messaging.MassTransit --version 1.2.62
Usage
1. Register Kafka Messaging with MassTransit
Use ServiceRegistration
to set up Kafka producers and consumers:
using Franz.Common.Messaging.MassTransit.Extensions;
services.AddMassTransitKafkaMessaging(cfg =>
{
cfg.Host("localhost:9092", h =>
{
h.Username = "your-username";
h.Password = "your-password";
});
});
2. Implement Kafka Producers and Consumers
Define Kafka producer and consumer interfaces:
using Franz.Common.Messaging.MassTransit.Contracts;
public interface IOrderCreatedProducer : IKafkaProducer<OrderCreatedEvent> { }
public interface IOrderCreatedConsumer : IKafkaConsumer<OrderCreatedEvent> { }
Implement the producer and consumer logic:
using Franz.Common.Messaging.MassTransit.Clients;
public class OrderCreatedProducer : KafkaProducer<OrderCreatedEvent>, IOrderCreatedProducer
{
public OrderCreatedProducer(IMessagingClient client) : base(client) { }
}
public class OrderCreatedConsumer : KafkaConsumer<OrderCreatedEvent>, IOrderCreatedConsumer
{
public OrderCreatedConsumer(IMessagingClient client) : base(client) { }
}
3. Use Messaging Clients
Leverage IMessagingClient
to abstract messaging operations:
using Franz.Common.Messaging.MassTransit.Clients;
public class MessagingService
{
private readonly IMessagingClient _messagingClient;
public MessagingService(IMessagingClient messagingClient)
{
_messagingClient = messagingClient;
}
public async Task PublishMessageAsync<T>(T message) where T : class
{
await _messagingClient.PublishAsync(message);
}
}
Integration with Franz Framework
The Franz.Common.Messaging.MassTransit package integrates seamlessly with:
- MassTransit: Enables robust event-driven messaging workflows.
- MassTransit.Kafka: Adds Kafka transport support for MassTransit.
- Franz Framework: Extends Kafka messaging capabilities across distributed systems.
Contributing
This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:
- Clone the repository.
- Create a feature branch.
- Submit a pull request for review.
License
This library is licensed under the MIT License. See the LICENSE
file for more details.
Changelog
Version 1.2.62
- Added
IKafkaProducer
andIKafkaConsumer
interfaces for Kafka operations. - Integrated
IMessagingClient
for abstracted messaging operations. - Provided
ServiceRegistration
for streamlined Kafka setup with MassTransit. - Full compatibility with MassTransit and MassTransit.Kafka.
Product | Versions 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 was computed. 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. |
-
net8.0
- MassTransit (>= 8.3.4)
- MassTransit.Kafka (>= 8.3.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.