![]() |
VOOZH | about |
dotnet add package LightningQueues --version 0.6.0
NuGet\Install-Package LightningQueues -Version 0.6.0
<PackageReference Include="LightningQueues" Version="0.6.0" />
<PackageVersion Include="LightningQueues" Version="0.6.0" />Directory.Packages.props
<PackageReference Include="LightningQueues" />Project file
paket add LightningQueues --version 0.6.0
#r "nuget: LightningQueues, 0.6.0"
#:package LightningQueues@0.6.0
#addin nuget:?package=LightningQueues&version=0.6.0Install as a Cake Addin
#tool nuget:?package=LightningQueues&version=0.6.0Install as a Cake Tool
๐ .NET Tests
๐ NuGet version
LightningQueues is a high-performance, lightweight, store-and-forward message queue for .NET applications. Powered by LightningDB (LMDB), it ensures fast and durable persistence for sending and receiving messages, making it an excellent choice for lightweight and cross-platform message queuing needs.
To use LightningQueues, add it to your .NET project via NuGet:
dotnet add package LightningQueues
Hereโs how to use LightningQueues to set up a message queue and send a message:
using LightningQueues;
// Define queue location and create the queue
var queue = new QueueConfiguration()
.WithDefaults("C:\\path_to_your_queue_folder")
.BuildAndStart("queue-name");
// Send a message to the queue
var message = new Message
{
Data = "hello"u8.ToArray(),
Id = MessageId.GenerateRandom(), //source identifier (for the server instance) + message identifier
Queue = "queue-name",
Destination = new Uri("lq.tcp://localhost:port")
//Note the uri pattern, can be DNS, loopback, etc.
};
queue.Send(message);
// Start receiving messages asynchronously with IAsyncEnumerable<MessageContext>
var messages = queue.Receive("queue-name", token);
await foreach (var msg in messages)
{
//process the message and respond with one or more of the following
msg.QueueContext.ReceiveLater(TimeSpan.FromSeconds(1));
msg.QueueContext.SuccessfullyReceived(); //nothing more to do, done processing
msg.QueueContext.Enqueue(msg.Message); //ideally a new message enqueued to the queue name on the msg
msg.QueueContext.Send(msg.Message); //send a response or send a message to another uri;
msg.QueueContext.MoveTo("different-queue"); //moves the currently received message to a different queue
msg.QueueContext.CommitChanges(); // Everything previous is gathered in memory and committed in one transaction with LightningDB
}
To ensure everything is running smoothly, clone the repository and run:
dotnet test
LightningQueues supports TLS encryption to secure communication. The library provides hooks to enable custom certificate validation and encryption settings. For example:
var certificate = LoadYourCertificate();
configuration.SecureTransportWith(new TlsStreamSecurity(async (uri, stream) =>
{
//client side with no validation of server certificate
var sslStream = new SslStream(stream, true, (_, _, _, _) => true, null);
await sslStream.AuthenticateAsClientAsync(uri.Host);
return sslStream;
}),
new TlsStreamSecurity(async (_, stream) =>
{
var sslStream = new SslStream(stream, false);
await sslStream.AuthenticateAsServerAsync(certificate, false,
checkCertificateRevocation: false, enabledSslProtocols: SslProtocols.Tls12);
return sslStream;
}));
You can customize the encryption level based on your requirements.
Licensed under the MIT license.
| 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 4 NuGet packages that depend on LightningQueues:
| Package | Downloads |
|---|---|
|
FubuMVC.LightningQueues
Package Description |
|
|
LightningQueues.Storage.LMDB
LightningQueues.Storage.LMDB |
|
|
FubuTransportation.LightningQueues
LightningQueues integration for FubuTransporation projects |
|
|
JasperBus
Jasper Service Bus for Messaging Based Architectures |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.6.0 | 1,342 | 12/24/2025 |
| 0.5.0 | 2,114 | 3/4/2025 |
| 0.5.0-alpha.2 | 162 | 2/27/2025 |
| 0.5.0-alpha.1 | 136 | 2/27/2025 |
| 0.4.0 | 3,469 | 1/16/2021 |
| 0.3.2 | 2,942 | 3/25/2020 |
| 0.3.1 | 2,110 | 3/20/2020 |
| 0.3.0 | 2,146 | 2/26/2020 |
| 0.2.12 | 35,125 | 11/23/2016 |
| 0.2.11 | 8,019 | 11/8/2016 |
| 0.2.10 | 5,154 | 9/23/2016 |
| 0.2.9 | 4,386 | 9/2/2016 |
| 0.2.8 | 3,379 | 8/29/2016 |
| 0.2.7 | 3,147 | 8/20/2016 |
| 0.2.6 | 3,400 | 8/20/2016 |
| 0.2.5 | 3,650 | 8/16/2016 |
| 0.2.4 | 3,250 | 8/10/2016 |
| 0.2.3 | 4,055 | 8/8/2016 |
| 0.2.2 | 3,233 | 8/3/2016 |
| 0.2.1 | 3,418 | 7/29/2016 |