示例#1
0
        // bunch [connectionparams, queue] ()
        private void AddConnection(TaskQueue.Providers.QueueConnectionParameters qcp)
        {
            //qcp.QueueTypeName = qI.QueueType;
            //qcp.QueueInstance = qI;

            MessageChannels.AddConnection(qcp);
        }
示例#2
0
        public ChannelAnteroom GetAnteroom(string name)
        {
            ChannelAnteroom anteroom = null;

            if (Anterooms.TryGetValue(name, out anteroom))
            {
                return(anteroom);
            }
            else
            {
                MessageChannel mc = GetInstanceByName(name);
                anteroom             = new ChannelAnteroom();
                anteroom.ChannelName = name;

                TaskQueue.Providers.QueueConnectionParameters qparams = Connections[mc.ConnectionName];
                anteroom.Queue = qparams.QueueInstance;
                //anteroom.Queue = (TaskQueue.ITQueue)Activator.CreateInstance(qparams.QueueInstance.GetType()); //Queues.GetQueue(mc.QueueName);
                try
                {
                    anteroom.Queue.InitialiseFromModel(new RepresentedModel(typeof(TaskMessage)), qparams);// schema free only queue providers (mongodb)
                    // set selector to queue
                    anteroom.Queue.SetSelector(mc.consumerSelector);
                }
                catch (QueueConnectionException e)
                {
                    logger.Warning(e.Message);
                }
                catch (Exception e)
                {
                    logger.Exception(e, "Anterooms.Add", "anteroom initialisation error");
                }

                Anterooms.Add(name, anteroom);

                return(anteroom);
            }

            return(null);
        }
示例#3
0
 public void InitialiseFromModel(RepresentedModel model, QueueConnectionParameters connection)
 {
     this.m = model;
 }
示例#4
0
 public void AddConnection(QueueConnectionParameters conParameters)
 {
     Connections.Add(conParameters.Name, conParameters);
 }
示例#5
0
 public MemQueue(RepresentedModel model, QueueConnectionParameters connection)
 {
     this.InitialiseFromModel(model, connection);
     Name = connection.Name;
 }
示例#6
0
 public void Add(QueueConnectionParameters qcp)
 {
     MessageModels.Add(qcp);
 }
示例#7
0
        public void InitialiseFromModel(RepresentedModel model, QueueConnectionParameters connection)
        {
            this.model = model;
            this.connection = connection;

            SetSelector(TQItemSelector.DefaultFifoSelector);
            MongoQueueParams mongoparams = connection.specParams as MongoQueueParams;
            try
            {
                OpenConnection(mongoparams);
            }
            catch (Exception e)
            {
                throw new QueueConnectionException("can't open connection to: " + mongoparams.ConnectionString, e);
            }
        }
示例#8
0
 public MemQueue(RepresentedModel model, QueueConnectionParameters connection)
 {
     this.InitialiseFromModel(model, connection);
     Name = connection.Name;
 }
示例#9
0
 public void InitialiseFromModel(RepresentedModel model, QueueConnectionParameters connection)
 {
     this.m = model;
 }