Esempio n. 1
0
        /// <summary>
        /// 创建消息队列实例
        /// </summary>
        /// <param name="entity">队列配置</param>
        /// <returns>返回创建成功的队列实例,返回null表示创建失败</returns>
        public static IMessageQueue CreateMessageQueue(MessageQueueEntity entity)
        {
            if (entity == null)
            {
                return(null);
            }

            if (string.IsNullOrEmpty(entity.HandleType))
            {
                return(null);
            }

            var query = entity.HandleType.CreateInstance <IMessageQueue>();

            query.Initiate(entity);
            return(query);
        }
Esempio n. 2
0
        private static IAutoReveiveMessage CreateAutoReceiveMessage(MessageQueueEntity entity)
        {
            if (entity == null)
            {
                return(null);
            }

            if (string.IsNullOrEmpty(entity.AutoHandleType))
            {
                return(null);
            }

            var query = entity.AutoHandleType.CreateInstance <IAutoReveiveMessage>();

            query.Initiate(entity);
            return(query);
        }
Esempio n. 3
0
 /// <summary>
 /// 初始化消息队列
 /// </summary>
 /// <param name="configEntity">消息配置</param>
 public void Initiate(MessageQueueEntity configEntity)
 {
     ConfigEntity = configEntity;
     Initiate();
 }