Exemple #1
0
        public void Send(string msg)
        {
            _ctx.Binder.RoutingKey = "doscrape";
            _ctx.Binder.QueueName  = "";
            _ctx.Queue.Name        = "";

            _sender.Send(msg);
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
        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();
            }
        }
Exemple #5
0
 public void Send(string msg)
 {
     _ctx.Binder.RoutingKey = "importscrape";
     _sender.Send(msg);
 }