Esempio n. 1
0
 public SMDQueue(string title, int maxexectimer, int maxexecnum)
 {
     //LocalParams lp = new LocalParams();
     dbexec        = (IDBExec)Assembly.Load("bll").CreateInstance(GlobalModel.Lparams.SqlExecClassName);//获取实例
     _title        = title;
     _maxexectimer = maxexectimer;
     _maxexecnum   = maxexecnum;
 }
Esempio n. 2
0
 public bool InitCustomer(string url, string mqname, IDBExec dbexec)
 {
     try
     {
         _dbexec                       = dbexec;
         factory                       = new ConnectionFactory(url);
         connection                    = factory.CreateConnection();
         connection.ClientId           = mqname;
         connection.RequestTimeout     = new TimeSpan(10 * 1000 * 10000);//10秒
         connection.ExceptionListener += new ExceptionListener(Connection_ExceptionListener);
         connection.Start();
         session       = connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
         responseQueue = new ActiveMQQueue(mqname);
         consumer      = session.CreateConsumer(responseQueue);
         SMSLog.Error("ActiveMQClient::InitCustomer:成功,mqname=" + mqname + ",url=" + url + ",ReadMobileNum=" + GlobalModel.Lparams.ReadMobileNum);
         return(true);
     }
     catch (Exception ex)
     {
         ExceptionMsg = ex.Message;
         SMSLog.Error("ActiveMQClient::InitCustomer:失败", ex.Message);
     }
     return(false);
 }