Exemplo n.º 1
0
        public void send <MSG>(MSG message, string queueName, string url, bool toLog = true)
        {
            ConnectionFactory conFactory = new ConnectionFactory(url);
            NmsTemplate       temp       = new NmsTemplate(conFactory);

            temp.Send(queueName, new GenericMessageCreator <MSG>(message));

            if (toLog)
            {
                writeToLog("Sended message to " + queueName);
            }
        }
Exemplo n.º 2
0
        public void writeToLog(string message, LogMessage.LogType type = LogMessage.LogType.INFO)
        {
            LogMessage msg = new LogMessage();

            msg.Message     = message;
            msg.MessageType = type;
            msg.ServiceName = serviceName;

            ConnectionFactory conFactory = new ConnectionFactory(Config.Url);
            NmsTemplate       temp       = new NmsTemplate(conFactory);

            temp.Send(Config.QueueName, new GenericMessageCreator <LogMessage>(msg));
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Email testModel = new Email();

            testModel.Receiver = "*****@*****.**";
            testModel.Text     = "TEST TEST TEST";
            testModel.Header   = "Nagłówek";

            ConnectionFactory conFactory = new ConnectionFactory(Config.Url);
            NmsTemplate       temp       = new NmsTemplate(conFactory);

            temp.Send(Config.QueueName, new MessageCreator(testModel));
        }