HarakaMQ
vert to netstandard and added more usability to the messagebroker
? Antrian pesan saat ini tidak berfungsi saat saya sedang memperbaikinya. Saya sedang mengerjakan cabang ini https://github.com/Rotvig/HarakaMQ/tree/add_unit_tests?
Middleware Berorientasi Pesan yang Andal Berdasarkan UDP
https://www.nuget.org/packages/HarakaMQ.Client/
Jalankan Broker dengan membangun proyek MessageBroker, dan jalankan dengan perintah "dotnet HarakaMQ.MessageBroker.dll". Saat menjalankan pengaturan cluster, miliki folder terpisah dengan dll yang dibuat untuk setiap broker yang Anda miliki. Ingatlah untuk menambahkan file "settings.json" di direktori yang sedang berjalan dengan konten ini:
{
"BrokerPort" : 11100 ,
"PrimaryNumber" : 1 ,
"AntiEntropyMilliseonds" : 1000 ,
"RunInCLusterSetup" : false ,
"Brokers" :[]
}
var factory = new ConnectionFactory { HostName = "127.0.0.1" , ListenPort = 11000 , Port = 11100 } ;
using ( var connection = factory . CreateConnection ( ) )
using ( var channel = connection . CreateModel ( ) )
{
channel . QueueDeclare ( "hello" ) ;
channel . BasicPublish ( "hello" , Encoding . UTF8 . GetBytes ( "Hello world" ) ) ;
Console . WriteLine ( " Press [enter] to exit." ) ;
Console . ReadLine ( ) ;
}
var factory = new ConnectionFactory { HostName = "127.0.0.1" , ListenPort = 12000 , Port = 11100 } ;
using ( var connection = factory . CreateConnection ( ) )
using ( var channel = connection . CreateModel ( ) )
{
channel . QueueDeclare ( "hello" ) ;
var consumer = new DefaultBasicConsumer ( channel ) ;
consumer . Received += ( model , ea ) =>
{
Console . WriteLine ( Encoding . UTF8 . GetString ( ea . Body ) ) ;
} ;
channel . BasicConsume ( "hello" , consumer ) ;
Console . WriteLine ( " Press [enter] to exit." ) ;
Console . ReadLine ( ) ;
}
https://github.com/Rotvig/HarakaMQ-Benchmark