README.md

April 13, 2026 ยท View on GitHub

FoundatioFoundatio

Build status NuGet Version feedz.io Discord

Pluggable foundation blocks for building loosely coupled distributed apps.

โœจ Why Choose Foundatio?

  • ๐Ÿ”Œ Pluggable implementations - Swap Redis, Azure, AWS, or in-memory with no code changes
  • ๐Ÿงช Developer friendly - In-memory implementations for fast local development and testing
  • ๐Ÿ’‰ DI native - Built for Microsoft.Extensions.DependencyInjection
  • ๐ŸŽฏ Interface-first - Code against abstractions, not implementations
  • โšก Production ready - Battle-tested in high-scale applications
  • ๐Ÿ”„ Consistent APIs - Same patterns across caching, queues, storage, and more

๐Ÿงฑ Core Building Blocks

FeatureDescription
CachingIn-memory, Redis, and hybrid caching with automatic invalidation
QueuesReliable message queuing with Redis, Azure, AWS SQS
LocksDistributed locking and throttling
MessagingPub/sub with Redis, RabbitMQ, Kafka, Azure Service Bus
JobsBackground job processing with queue integration
File StorageUnified file API for disk, S3, Azure Blob, and more
ResilienceRetry policies, circuit breakers, and timeouts

๐Ÿš€ Quick Start

dotnet add package Foundatio.RabbitMQ
// Messaging
IMessageBus messageBus = new RabbitMQMessageBus(o => o
    .ConnectionString("amqp://localhost"));
await messageBus.PublishAsync(new MyMessage { Data = "Hello" });

๐Ÿ“ฆ Provider Implementations

ProviderCachingQueuesMessagingStorageLocks
In-Memoryโœ…โœ…โœ…โœ…โœ…
Redisโœ…โœ…โœ…โœ…โœ…
Azure Storageโœ…โœ…
Azure Service Busโœ…โœ…
AWS (S3/SQS/SNS)โœ…โœ…โœ…
RabbitMQโœ…
Kafkaโœ…
Minioโœ…
Aliyunโœ…
SFTPโœ…

๐Ÿ“š Learn More

๐Ÿ‘‰ Complete Documentation

Delayed Message Delivery

Foundatio.RabbitMQ supports delayed message delivery via the DeliveryDelay option on PublishAsync.

Current behavior:

  1. RabbitMQ < 4.3 with plugin installed: If the rabbitmq_delayed_message_exchange plugin is detected, it is used for delayed delivery. A warning is logged because the plugin is deprecated and will not work on RabbitMQ 4.3+.
  2. RabbitMQ < 4.3 without plugin: Falls back to an in-memory delay scheduler provided by MessageBusBase. Messages are held in process memory and delivered after the delay. This is not durable -- delayed messages are lost if the process restarts.
  3. When the RabbitMQ server version is detected as >= 4.3: The plugin probe is skipped (the plugin depends on Mnesia, which was removed in 4.3), and the in-memory fallback is used automatically. If the server version cannot be determined from ServerProperties["version"], the probe may still be attempted before falling back.

Migration guidance:

The rabbitmq_delayed_message_exchange plugin is archived and no longer maintained. RabbitMQ 4.3 removes Mnesia, making the plugin incompatible. If you rely on delayed messages:

  • On RabbitMQ < 4.3: The plugin still works but logs a deprecation warning at startup.
  • On RabbitMQ >= 4.3: Delayed messages use the in-memory fallback automatically. Be aware that these are not durable across process restarts.
  • For durable delayed delivery on RabbitMQ 4.3+, consider implementing TTL + Dead-Letter Exchange patterns or using an external scheduler.

Core Features

  • Getting Started - Installation and setup
  • Caching - In-memory, Redis, and hybrid caching with invalidation
  • Queues - FIFO message delivery with lock renewal and retry policies
  • Locks - Distributed locking with null handling patterns
  • Messaging - Pub/sub with size limits and notification patterns
  • File Storage - Unified file API across providers
  • Jobs - Background job processing and hosted service integration

Advanced Topics

๐Ÿ“ฆ CI Packages (Feedz)

Want the latest CI build before it hits NuGet? Add the Feedz source and install the pre-release version:

dotnet nuget add source https://f.feedz.io/foundatio/foundatio/nuget -n foundatio-feedz
dotnet add package Foundatio.RabbitMQ --prerelease

Or add to your NuGet.config:

<configuration>
  <packageSources>
    <add key="foundatio-feedz" value="https://f.feedz.io/foundatio/foundatio/nuget" />
  </packageSources>
  <packageSourceMapping>
    <packageSource key="foundatio-feedz">
      <package pattern="Foundatio.*" />
    </packageSource>
  </packageSourceMapping>
</configuration>

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. See our documentation for development guidelines.

Development Setup:

  1. Clone the repository
  2. Open Foundatio.RabbitMQ.slnx in Visual Studio or VS Code
  3. Run dotnet build to build
  4. Run dotnet test to run tests

๐Ÿ“„ License

Apache 2.0 License

Thanks to all the people who have contributed

contributors