Repository navigation
Transports Overview
Connect your microservices using various messaging transports for distributed data mapping and real-time communication.
In a microservices architecture, your entities are distributed across different services. FxMap uses message transports to fetch data from remote services seamlessly, making it feel like everything is local.
// Define a distributed key contract (shared between services)
public class UserDistributedKey : IDistributedKey { }
// Provider side: configure entity via FluentAPI
public class UserConfig : EntityConfigureOf<User>
{
protected override void Configure()
{
Id(x => x.Id);
DefaultProperty(x => x.Name);
UseDistributedKey<UserDistributedKey>();
}
}
// Consumer side: declare a profile for your DTO
public class OrderResponseProfile : ProfileOf<OrderResponse>
{
protected override void Configure()
{
UseDistributedKey<UserDistributedKey>()
.Of(x => x.UserId)
.For(x => x.UserName)
.For(x => x.UserEmail, "Email");
}
}
// Behind the scenes:
// 1. FxMap resolves the profile and distributed key
// 2. Sends a message via configured transport (RabbitMQ, gRPC, etc.)
// 3. Remote service processes request and returns data
// 4. FxMap maps the response to your DTOPopular AMQP message broker with robust routing and reliability features.
High-performance, cloud-native messaging system with simplicity at its core.
Distributed event streaming platform for high-throughput, fault-tolerant messaging.
High-performance RPC framework using HTTP/2 and Protocol Buffers.
Enterprise-grade cloud messaging service with advanced features.
Fully managed message queuing service with AWS infrastructure.
All transports are configured within the AddFxMap configuration block:
builder.Services.AddFxMap(cfg =>
{
// Register entity configs (service that owns data) and profiles (service that maps DTOs)
cfg.AddEntitiesFromAssemblyContaining<SomeEntityAssemblyMarker>();
// Configure transport (examples below)
cfg.AddRabbitMq(config => config.Host("localhost", "/"));
// OR
cfg.AddNats(c => c.NatsOpts(opts => opts.Url = "nats://localhost:4222"));
// OR
cfg.AddKafka(c => c.Host("localhost:9092"));
// OR
cfg.AddGrpcClients(c => c.AddGrpcHosts("http://localhost:5001"));
// OR
cfg.AddAzureServiceBus(c => c.Host("Endpoint=sb://..."));
// OR
cfg.AddSqs(sqs => sqs.Region(RegionEndpoint.USEast1));
});FxMap automatically routes requests to the correct service based on the distributed keys in your entity configs and profiles.
Multiple requests for the same entity type are automatically batched into a single transport call for optimal performance.
Profiles and entity configs do not change when you switch the transport: only the registration call changes.
A configurable retry policy for a failed request, and a supervisor with a circuit breaker that restarts a failing server on the brokered transports.
Source: https://fxmapper.net/docs/transports/ — the website is always the most up to date version.
Introduction
Getting Started
Configuration
- Service Registration
- Entities & Profiles
- Handlers
- Pipelines
- Strongly Typed IDs
- Error Handling
- Retry Policy
- Supervisor
- Telemetry
- Kestrel (HTTP/2)
- Analyzers
Expressions
- Overview
- Property Access
- Filters, Sorting & Paging
- Functions
- Aggregations
- Projections
- Coalesce & Ternary
- GroupBy
Data Providers
Transports
Integrations
Quality
AI Assistants
Migration
Release Notes