Beispiel #1
0
 public static string rmqprod(List <string> args)
 {
     try
     {
         producer = new RabbitMQProducer <IncidentData>("localhost", 5672, "test");
         producer.Connect();
         return("Producer Connected");
     } catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Beispiel #2
0
        public static string rmqsend(List <string> args)
        {
            if (args.Count == 0)
            {
                return("rmqsend requires 1 argument");
            }

            producer.Connect();
            IncidentData data = new IncidentData();

            data.Data["Message"] = args[0];
            producer.SendObject(data);

            return("Message sent");
        }