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));
        }
        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);
 }
        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));
        }