Пример #1
0
        protected override IChannel buildChannel(ChannelNode channelNode)
        {
            var uri = new LightningUri(channelNode.Uri);

            return(channelNode.Mode == ChannelMode.DeliveryGuaranteed
                ? LightningQueuesChannel.BuildPersistentChannel(uri, _queues, _settings.MapSize, _settings.MaxDatabases, channelNode.Incoming)
                : LightningQueuesChannel.BuildNoPersistenceChannel(uri, _queues, channelNode.Incoming));
        }
Пример #2
0
        public void Send(Envelope envelope)
        {
            var uri = new LightningUri(envelope.Destination);

            var message = new OutgoingMessage
            {
                Id = MessageId.GenerateRandom(),
                Data = envelope.Data,
                Headers = envelope.Headers.ToDictionary(),
                SentAt = DateTime.UtcNow,
                Destination = envelope.Destination,
                Queue = uri.QueueName
            };

            message.TranslateHeaders();

            _context.Send(message);
        }
Пример #3
0
        public void Send(Envelope envelope)
        {
            var uri = new LightningUri(envelope.Destination);

            var message = new OutgoingMessage
            {
                Id          = MessageId.GenerateRandom(),
                Data        = envelope.Data,
                Headers     = envelope.Headers.ToDictionary(),
                SentAt      = DateTime.UtcNow,
                Destination = envelope.Destination,
                Queue       = uri.QueueName
            };

            message.TranslateHeaders();

            _context.Send(message);
        }
 public static LightningQueuesChannel BuildNoPersistenceChannel(LightningUri uri, IPersistentQueues queues, bool incoming)
 {
     var queueManager = queues.NonPersistentManagerFor(uri.Port, incoming);
     return new LightningQueuesChannel(uri.Address, uri.QueueName, queueManager);
 }
 public static LightningQueuesChannel BuildPersistentChannel(LightningUri uri, IPersistentQueues queues, int mapSize, int maxDatabases, bool incoming)
 {
     var queueManager = queues.PersistentManagerFor(uri.Port, incoming, mapSize, maxDatabases);
     return new LightningQueuesChannel(uri.Address, uri.QueueName, queueManager);
 }
Пример #6
0
 public void CreateQueue(LightningUri uri)
 {
     GetQueue(uri.Port, true, true).CreateQueue(uri.QueueName);
 }
Пример #7
0
 public void CreateQueue(LightningUri uri)
 {
     _queueManagers[uri.Port].CreateQueues(uri.QueueName);
 }
 public static LightningQueuesChannel Build(LightningUri uri, IPersistentQueues queues, IDelayedMessageCache<MessageId> delayedMessages, bool incoming)
 {
     var queueManager = queues.ManagerFor(uri.Port, incoming);
     return new LightningQueuesChannel(uri.Address, uri.QueueName, queueManager, delayedMessages);
 }
Пример #9
0
        public static LightningQueuesChannel BuildNoPersistenceChannel(LightningUri uri, IPersistentQueues queues, bool incoming)
        {
            var queueManager = queues.NonPersistentManagerFor(uri.Port, incoming);

            return(new LightningQueuesChannel(uri.Address, uri.QueueName, queueManager));
        }
Пример #10
0
        public static LightningQueuesChannel BuildPersistentChannel(LightningUri uri, IPersistentQueues queues, int mapSize, int maxDatabases, bool incoming)
        {
            var queueManager = queues.PersistentManagerFor(uri.Port, incoming, mapSize, maxDatabases);

            return(new LightningQueuesChannel(uri.Address, uri.QueueName, queueManager));
        }
Пример #11
0
 public void CreateQueue(LightningUri uri)
 {
     _queueManagers[uri.Port].CreateQueues(uri.QueueName);
 }
Пример #12
0
        public IChannel BuildDestinationChannel(Uri destination)
        {
            var lqUri = new LightningUri(destination);

            return(new LightningQueuesReplyChannel(destination, _queues.ManagerForReply(), lqUri.QueueName));
        }
 public IChannel BuildDestinationChannel(Uri destination)
 {
     var lqUri = new LightningUri(destination);
     return new LightningQueuesReplyChannel(destination, _queues.ManagerForReply(), lqUri.QueueName);
 }
 protected override IChannel buildChannel(ChannelNode channelNode)
 {
     var uri = new LightningUri(channelNode.Uri);
     return channelNode.Mode == ChannelMode.DeliveryGuaranteed
         ? LightningQueuesChannel.BuildPersistentChannel(uri, _queues, _settings.MapSize, _settings.MaxDatabases, channelNode.Incoming)
         : LightningQueuesChannel.BuildNoPersistenceChannel(uri, _queues, channelNode.Incoming);
 }
Пример #15
0
 public void CreateQueue(LightningUri uri)
 {
     GetQueue(uri.Port, true, true).CreateQueue(uri.QueueName);
 }
Пример #16
0
        public static LightningQueuesChannel Build(LightningUri uri, IPersistentQueues queues, IDelayedMessageCache <MessageId> delayedMessages, bool incoming)
        {
            var queueManager = queues.ManagerFor(uri.Port, incoming);

            return(new LightningQueuesChannel(uri.Address, uri.QueueName, queueManager, delayedMessages));
        }