AliceMQ 1.0.11
dotnet add package AliceMQ --version 1.0.11
NuGet\Install-Package AliceMQ -Version 1.0.11
<PackageReference Include="AliceMQ" Version="1.0.11" />
paket add AliceMQ --version 1.0.11
#r "nuget: AliceMQ, 1.0.11"
// Install AliceMQ as a Cake Addin #addin nuget:?package=AliceMQ&version=1.0.11 // Install AliceMQ as a Cake Tool #tool nuget:?package=AliceMQ&version=1.0.11
AliceMQ
<img src="https://github.com/jkone27/AliceMQ/blob/master/Pics/Whiterabbit_tenniel.jpg?raw=true" width="20%" height="20%"/>
An easy to use frontend for MQ system (now supporting RabbitMq only, but would be nice to extend to other systems) using Reactive Extensions and a Publish/Subscribe paradigm.
Mailman (Producer)
Usage of a mailman is dead simple:
using AliceMQ.MailMan; //..
var source = new Source("A", "A.q");
var endPoint = new EndPoint();
var sink = new Sink(source);
var serialization = new JsonSerializerSettings
{
MissingMemberHandling = MissingMemberHandling.Error
};
var p = new Mailman(endPoint, source.Exchange, s => JsonConvert.SerializeObject(s, serialization));
//first message published creates exchange if non existent
p.PublishOne(new Msg(-1),"");
Now let's see the simplest form of consumer, which is just a thin layer from the real MQ system...
Mailbox (Consumer)
Consumer subscription is identical for every type, giving an istance of an IObservable<T> (rx).
using AliceMQ.Mailbox;
var mb = new SimpleMailbox(endPoint, sink);
var d = mb.Subscribe(am =>
{
Console.WriteLine("A - " + Encoding.UTF8.GetString(am.EventArgs.Body));
am.Channel.BasicAck(am.EventArgs.DeliveryTag, false);
});
//...
d.Dispose();
CustomMailBox (Typed Consumer)
let's consider an example DTO class Msg, the typed consumer is build upon the common consumer, which is enhanced with message body deserialization into an istance of a generic T type.
var sfm = new Mailbox<Msg>(endPoint, sink, s => JsonConvert.DeserializeObject<Msg>(s, serialization));
var d = sfm.Subscribe(am =>
{
if (am.IsOk<Msg>())
{
var msg = am.AsOk<Msg>().Message;
Console.WriteLine("ok - " + msg.Bla);
am.Confirm();
}
else
{
Console.WriteLine("error - " + am.AsError().Ex.Message);
am.Confirm();
}
},
ex => Console.WriteLine("COMPLETE ERROR"),
() => Console.WriteLine("COMPLETE"));
//...
d.Dispose();
Mailbox and Mailman Args
Both Mailman and Mailbox need that you provide some basic parameters for configuring the Endpoint, the Source (namely Exchange and Queue), and the Mailbox (with more sofisticated configurations).
EndpointArgs
string ConnectionUrl
bool AutomaticRecoveryEnabled
TimeSpan NetworkRecoveryInterval
Source
IExchange Exchange
IQueueArgs QueueArgs
IExchange
string ExchangeName
string ExchangeType
bool Durable
bool AutoDelete
IDictionary<string, object> Properties
IQueueArgs
string QueueName
bool Durable
bool Exclusive
bool AutoDelete
Sink
string DeadLetterExchangeName
IDictionary<string, object> QueueDeclareArguments
Source Source
BasicQualityOfService BasicQualityOfService
ConfirmationPolicy ConfirmationPolicy
QueueBind QueueBind
QueueBind
string RoutingKey
IDictionary<string, object> Arguments
BasicQualityOfService
ushort PrefetchCount
bool Global
ConfirmationPolicy
bool AutoAck
bool Multiple
bool Requeue
Status
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.5 is compatible. netstandard1.6 was computed. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 1.5
- NETStandard.Library (>= 1.6.1)
- RabbitMq.Client (>= 5.0.1)
- System.Reactive (>= 3.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
updated to dotnetcore