public void Send(string msg) { _ctx.Binder.RoutingKey = "doscrape"; _ctx.Binder.QueueName = ""; _ctx.Queue.Name = ""; _sender.Send(msg); }
static void Main(string[] args) { ctx = new RabbitContext().Create("cv.test.json"); RmqSender sender = new RmqSender(ctx); while (true) { WriteLine("enter a msg to send"); string msg = ReadLine(); sender.Send(msg); } }
static void fanoutSender() { _ctx = new RabbitContext().Create("logs", "fanout"); _sender = new RmqSender(_ctx); int cnt = 0; while (true) { cnt++; _sender.Send("info: Hello World! " + cnt.ToString()); Console.WriteLine("press enter to send another message..."); Console.ReadLine(); } }
static void directSender() { string exchange = "direct_logs"; string exchangeType = "direct"; string routingKey = "info"; _ctx = new RabbitContext().Create(exchange, exchangeType, routingKey); _sender = new RmqSender(_ctx); int cnt = 0; while (true) { cnt++; _sender.Send("info: Hello World! " + cnt.ToString()); Console.WriteLine("press enter to send another message..."); Console.ReadLine(); } }
public void Send(string msg) { _ctx.Binder.RoutingKey = "importscrape"; _sender.Send(msg); }