Ejemplo n.º 1
0
        public void BindProductor(String QueueName,SmsBindTemp temp,SmsBind vo)
        {
            try
            {
                m_mq.CreateProducer(false, QueueName + temp.getHostName());
                List<Property> m_lstProperty = new List<Property>();

                //TODO//等待完成
                Property sn;
                sn.name = "sn";
                sn.value = temp.getSn();
                m_lstProperty.Add(sn);

                Property uuid;
                uuid.name = "uuid";
                uuid.value =temp.getUuid();
                m_lstProperty.Add(uuid);

                Property name;
                name.name = "name";
                name.value = temp.getName();
                m_lstProperty.Add(name);

                Property userId;
                userId.name = "userId";
                userId.value = temp.getUserId();
                m_lstProperty.Add(userId);
                Property phone;
                phone.name = "phone";
                phone.value = temp.getPhone();
                m_lstProperty.Add(phone);

                Property address;
                address.name = "address";
                address.value = temp.getAddress();
                m_lstProperty.Add(address);
                Property idNumber;
                idNumber.name = "idNumber";
                idNumber.value = temp.getIdNumber();
                Property content;
                content.name = "content";
                content.value = vo.getContent();
                m_lstProperty.Add(content);
                Property state;
                state.name = "state";
                state.value = vo.getState();
                m_lstProperty.Add(state);
                Property userMessageId;
                userMessageId.name = "userMessageId";
                userMessageId.value = temp.getUserMessageId();
                m_lstProperty.Add(userMessageId);
                m_mq.SendMQMessage("", m_lstProperty);
                Program.logWriter.WriteLine("=============MQ队列写入完成 电话号码:"+temp.getPhone()+"=============");
            }
            catch (Exception ex)
            {
                Program.logWriter.WriteLine("BindProductor Exception:" + ex.Message);
                Program.mqconnection = false;
            }
        }