示例#1
0
        public static QProperties Create(IDictionary prop)
        {
            QProperties mqp = new QProperties(Types.NZ(prop["QueueName"], "MQueue"));

            mqp.ServerPath    = Types.NZ(prop["ServerPath"], "localhost");
            mqp.QueueName     = Types.NZ(prop["QueueName"], "MQueue");
            mqp.Mode          = (CoverMode)Types.ToInt(prop["Mode"], (int)CoverMode.Memory);
            mqp.IsTrans       = Types.ToBool(prop["IsTrans"], false);
            mqp.MaxRetry      = (byte)Types.ToInt(prop["MaxRetry"], DefaultMaxRetry);
            mqp.ReloadOnStart = Types.ToBool(prop["ReloadOnStart"], false);
            return(mqp);
        }
示例#2
0
        public static QProperties Get(GenericNameValue gnv)
        {
            QProperties mqp = new QProperties()
            {
                QueueName     = gnv.Get("QueueName"),
                ServerPath    = gnv.Get("ServerPath", "localhost"),
                Mode          = (CoverMode)gnv.Get <int>("Mode", (int)CoverMode.Memory),
                IsTrans       = gnv.Get <bool>("IsTrans", false),
                MaxRetry      = (byte)gnv.Get <byte>("MaxRetry", DefaultMaxRetry),
                ReloadOnStart = gnv.Get <bool>("ReloadOnStart", false)
            };

            return(mqp);
        }
示例#3
0
        public static QProperties Get(GenericNameValue gnv)
        {
            QProperties mqp = new QProperties()
            {
                QueueName     = gnv.Get("QueueName"),
                ServerPath    = gnv.Get("ServerPath", "localhost"),
                Mode          = (CoverMode)gnv.Get <byte>("Mode", (byte)CoverMode.Memory),
                IsTrans       = gnv.Get <bool>("IsTrans", false),
                MaxRetry      = (byte)gnv.Get <byte>("MaxRetry", DefaultMaxRetry),
                ReloadOnStart = gnv.Get <bool>("ReloadOnStart", false),
                TargetPath    = gnv.Get("TargetPath", null),
                IsTopic       = gnv.Get <bool>("IsTopic", false),
                CommitMode    = (PersistCommitMode)gnv.Get <byte>("CommitMode", (byte)PersistCommitMode.None),
            };

            return(mqp);
        }