Exemple #1
0
 public DemoTask()
 {
     mq = ProducterPoolHelper.GetPool(new BusinessMQConfig()
     {
         ManageConnectString = "server=192.168.4.87;Initial Catalog=dyd_bs_MQ_manage;User ID=sa;Password=123456"
     }, "maohong");
 }
Exemple #2
0
 public MQSend()
 {
     mq = ProducterPoolHelper.GetPool(new BusinessMQConfig()
     {
         ManageConnectString = GetConfig.ManagerConnectStr
     }, GetConfig.MqPath);
 }
Exemple #3
0
        public void SendMessageDemo(string msg)
        {
            //发送字符串示例
            var p = ProducterPoolHelper.GetPool(new BusinessMQConfig()
            {
                ManageConnectString = "server=192.168.17.237;Initial Catalog=dyd_bs_MQ_manage;User ID=sa;Password=Xx~!@#;"
            },                                               //管理中心数据库
                                                "dyd.test"); //队列路径 .分隔,类似类的namespace,是队列的唯一标识,要提前告知运维在消息中心注册,方可使用。

            p.SendMessage(msg);
            //发送对象示例

            /* var obj = new message2 { text = "文字", num = 1 };
             * var p = ProducterPoolHelper.GetPool(new BusinessMQConfig() { ManageConnectString = "server=192.168.17.237;Initial Catalog=dyd_bs_MQ_manage;User ID=sa;Password=Xx~!@#;" },//管理中心数据库
             *  "test.diayadian.obj");//队列路径 .分隔,类似类的namespace,是队列的唯一标识,要提前告知运维在消息中心注册,方可使用。
             * p.SendMessage<message>(obj);
             */
        }