forked from Alexey/DAS_2024_1
19 lines
457 B
C#
19 lines
457 B
C#
|
|
|
|
using HelloWorld;
|
|
|
|
string brokerHost = "localhost";
|
|
|
|
string queueName = "hello";
|
|
|
|
using var sender = new Sender(brokerHost,"user", "password", queueName);
|
|
|
|
using var receiver = new Receiver(brokerHost, "user", "password", queueName);
|
|
|
|
receiver.AddMessageHandler(text => Console.WriteLine($"Received Message from rabbit: {text}"));
|
|
|
|
Console.WriteLine("Send Message to rabbit: Hellow World!");
|
|
sender.SendMessageToQueue("Hellow World!");
|
|
|
|
|
|
while (true) ; |