Fly.Sdk.Messaging
1.17.1
dotnet add package Fly.Sdk.Messaging --version 1.17.1
NuGet\Install-Package Fly.Sdk.Messaging -Version 1.17.1
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="Fly.Sdk.Messaging" Version="1.17.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fly.Sdk.Messaging" Version="1.17.1" />
<PackageReference Include="Fly.Sdk.Messaging" />
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 Fly.Sdk.Messaging --version 1.17.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Fly.Sdk.Messaging, 1.17.1"
#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 Fly.Sdk.Messaging@1.17.1
#: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=Fly.Sdk.Messaging&version=1.17.1
#tool nuget:?package=Fly.Sdk.Messaging&version=1.17.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Fly.Sdk.Messaging
MassTransit/RabbitMQ wiring and platform event contracts for FlyOS business app integration.
Installation
<PackageReference Include="Fly.Sdk.Messaging" Version="1.*" />
Note:
Fly.Sdk.Messagingdepends onFly.Sdk.Coreand will pull it in automatically.
What's Included
Extension Method
| Method | Description |
|---|---|
AddFlyMessaging(services, config, serviceName, configureConsumers?) |
Registers MassTransit with RabbitMQ transport, exponential retry (5 attempts, 1s–5min), correlation-ID filters, and a per-service endpoint name formatter ({serviceName}-{message-type}) so broadcast events reach every subscriber instead of being load-balanced across services. serviceName is required; pass the dev-manager / telemetry name ("calendar", "notifications", etc.). |
Platform Event Contracts
All events are C# record types in Fly.Sdk.Messaging.Events.
Tenant Events
| Record | Published By | When |
|---|---|---|
TenantCreated(TenantId, Slug, Name, LicensedAppIds) |
Controller | New tenant provisioned |
TenantUpdated(TenantId, Slug, Name) |
Controller | Tenant profile changed |
TenantSuspended(TenantId) |
Controller | Tenant suspended |
TenantActivated(TenantId) |
Controller | Tenant reactivated |
TenantMigrated(TenantId, NewIsolationTier) |
Controller | Isolation tier changed |
TenantProvisioningFailed(TenantId, FailedServices) |
Controller | Provisioning rollback needed |
TenantProvisioningRollback(TenantId) |
Controller | Rollback in progress |
User Events
| Record | Published By | When |
|---|---|---|
UserCreated(UserId, TenantId, Email, FirstName, LastName) |
Controller | New user registered |
UserUpdated(UserId, TenantId, Email) |
Controller | User profile changed |
UserDeactivated(UserId, TenantId) |
Controller | User deactivated |
UserRolesChanged(UserId, TenantId, Roles) |
Controller | Role assignment changed |
Twin Events
| Record | Published By | When |
|---|---|---|
TwinProvisioned(TwinUserId, LinkedUserId, TenantId, LinkedEmail, DisplayName, OccurredAtUtc) |
Controller | Twin shadow user + mapping committed |
TwinDeactivated(TwinUserId, LinkedUserId, TenantId, OccurredAtUtc) |
Controller | Twin mapping flipped inactive |
License Events
| Record | Published By | When |
|---|---|---|
LicenseUpdated(TenantId, LicensedApps, MaxUsers, ExpiresAt) |
Controller | License changed |
Settings Events
| Record | Published By | When |
|---|---|---|
SettingsUpdated(TenantId, AppId?, SectionKey) |
Controller | App settings changed |
UiLabelOverrideChanged(TenantId, AppId, LanguageCode) |
Controller | UI label overrides changed |
TranslationsUpdated(TenantId, LanguageCode) |
Controller | Translations updated |
CacheFallbackActivated(Service, Reason) |
Any service | Cache fallback triggered |
Service Events
| Record | Published By | When |
|---|---|---|
ServiceInitialized(TenantId, ServiceId) |
Business App | Tenant data initialized |
ServiceInitializationFailed(TenantId, ServiceId, Error) |
Business App | Initialization failed |
ServiceCallFailed(SourceService, TargetService, Endpoint, Error, CircuitState) |
Any service | Circuit breaker opened |
Notification Commands
| Record | Published By | When |
|---|---|---|
SendNotification(TenantId, Channel, RecipientUserIds, TemplateId, TemplateData) |
Any service | Send a platform notification |
SendEmail(TenantId, To, Subject, Body, IsHtml) |
Any service | Send a transactional email |
Quick Start
Register in Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddFlyCore();
builder.Services.AddFlyMessaging(builder.Configuration, serviceName: "my-app", configureConsumers: x =>
{
x.AddConsumersFromNamespaceContaining<TenantCreatedConsumer>();
// Optional: EF Core outbox for exactly-once delivery
x.AddEntityFrameworkOutbox<MyAppDbContext>(o => o.UseBusOutbox());
});
Implement a Consumer
using Fly.Sdk.Messaging.Events;
using MassTransit;
public class TenantCreatedConsumer : IConsumer<TenantCreated>
{
private readonly MyAppDbContext _db;
public TenantCreatedConsumer(MyAppDbContext db) => _db = db;
public async Task Consume(ConsumeContext<TenantCreated> context)
{
var tenantId = context.Message.TenantId;
_db.MyEntities.Add(new MyEntity
{
TenantId = tenantId,
Name = "Default",
IsActive = true
});
await _db.SaveChangesAsync();
// Signal back to the platform that this service is ready for this tenant
await context.Publish(new ServiceInitialized(tenantId, "my-app"));
}
}
Publish a Notification
using Fly.Sdk.Messaging.Events;
using MassTransit;
public class ProjectService
{
private readonly IPublishEndpoint _bus;
public async Task NotifyAssigneeAsync(Guid tenantId, Guid userId, string projectName)
{
await _bus.Publish(new SendNotification(
TenantId: tenantId,
Channel: "in-app",
RecipientUserIds: [userId],
TemplateId: "project-assigned",
TemplateData: new() { ["projectName"] = projectName }
));
}
}
Configuration
Add to appsettings.json:
{
"RabbitMQ": {
"Host": "localhost",
"VirtualHost": "/",
"Username": "guest",
"Password": "guest"
}
}
Retry Policy
AddFlyMessaging configures exponential backoff automatically:
- 5 retry attempts
- Min interval: 1 second
- Max interval: 5 minutes
- Delta: 5 seconds per step
Dependencies
Fly.Sdk.Core1.xMassTransit.RabbitMQ8.x
Related Packages
- Fly.Sdk.Core — Multi-tenancy, auth, caching, API models. Required by this package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net10.0
- AspNetCore.HealthChecks.NpgSql (>= 9.0.0)
- AspNetCore.HealthChecks.Rabbitmq (>= 9.0.0)
- AspNetCore.HealthChecks.Redis (>= 9.0.0)
- Azure.Identity (>= 1.17.2)
- FluentValidation.AspNetCore (>= 11.3.1)
- Fly.Sdk.Core (>= 1.36.0)
- Fly.Sdk.Telemetry (>= 1.3.4)
- MassTransit (>= 8.5.9)
- MassTransit.RabbitMQ (>= 8.5.9)
- Microsoft.AspNetCore.DataProtection.Abstractions (>= 10.0.9)
- Microsoft.AspNetCore.DataProtection.StackExchangeRedis (>= 10.0.9)
- Microsoft.EntityFrameworkCore (>= 10.0.9)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.9)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Caching.Memory (>= 10.0.9)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 10.0.9)
- Microsoft.Extensions.Configuration (>= 10.0.9)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.9)
- Microsoft.Extensions.DependencyInjection (>= 10.0.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Http.Resilience (>= 10.7.0)
- Microsoft.Extensions.Logging (>= 10.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Options (>= 10.0.9)
- Microsoft.OpenApi (>= 2.7.5)
- Npgsql (>= 10.0.3)
- OpenTelemetry (>= 1.15.3)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.15.3)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.15.2)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.15.1-beta.1)
- OpenTelemetry.Instrumentation.Http (>= 1.15.1)
- OpenTelemetry.Instrumentation.Runtime (>= 1.15.1)
- OpenTelemetry.Instrumentation.StackExchangeRedis (>= 1.15.1-beta.1)
- StackExchange.Redis (>= 2.12.8)
- Swashbuckle.AspNetCore (>= 10.1.7)
- System.Security.Cryptography.Xml (>= 10.0.10)
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 |
|---|---|---|
| 1.17.1 | 79 | 8/29/2026 |