public IChannel[] Start(IHandlerPipeline pipeline, BusSettings settings, OutgoingChannels channels) { _pipeline = pipeline; foreach (var messageType in _handlers.Chains.Select(x => x.MessageType).Where(x => x.CanBeCastTo <ClientMessage>())) { JsonSerialization.RegisterType(messageType.ToMessageAlias(), messageType); } _retries = channels.DefaultRetryChannel; return(new IChannel[] { new OutgoingWebSocketChannel(this) }); }
public IChannel[] Start(IHandlerPipeline pipeline, BusSettings settings, OutgoingChannels channels) { _pipeline = pipeline; foreach (var address in settings.KnownSubscribers.Where(x => x.Uri.Scheme == Protocol)) { Channels[address.Uri] = new StubChannel(address.Uri, _replyUri, pipeline, address); } foreach (var node in settings.Listeners.Where(x => x.Uri.Scheme == Protocol)) { Channels.FillDefault(node.Uri); } return(Channels.GetAll().OfType <IChannel>().ToArray()); }
public IChannel[] Start(IHandlerPipeline pipeline, BusSettings settings, OutgoingChannels channels) { if (_settings.State == TransportState.Disabled) { return(new IChannel[0]); } var provider = buildQueueProvider(channels); _sender.Start(this); _queues = new QueueCollection(Logger, provider, pipeline, _cancellation.Token); var queueNames = _settings.AllQueueNames(); Persistence.Initialize(queueNames); foreach (var queue in _settings) { _queues.AddQueue(queue.Name, queue.Parallelization); } if (_settings.Port.HasValue) { _replyUri = $"{Protocol}://{settings.MachineName}:{_settings.Port}/{TransportConstants.Replies}" .ToUri(); _listener = new ListeningAgent(_queues, _settings.Port.Value, Protocol, _cancellation.Token); _listener.Start(); } Persistence.RecoverOutgoingMessages(enqueue, _cancellation.Token); Persistence.RecoverPersistedMessages(queueNames, env => _queues.Enqueue(env.Queue, env), _cancellation.Token); return(settings.KnownSubscribers.Where(x => x.Uri.Scheme == Protocol) .Select(x => new Channel(x, this)).OfType <IChannel>().ToArray()); }
protected override IQueueProvider buildQueueProvider(OutgoingChannels channels) { return(new DurableQueueProvider(Persistence)); }
protected abstract IQueueProvider buildQueueProvider(OutgoingChannels channels);
protected override IQueueProvider buildQueueProvider(OutgoingChannels channels) { return(new LightweightQueueProvider(() => channels[TransportConstants.RetryUri])); }
public IChannel[] Start(IHandlerPipeline pipeline, BusSettings settings, OutgoingChannels channels) { _settings = settings.Loopback; _retryChannel = new Lazy <IChannel>(() => channels.DefaultRetryChannel); return(startListeners(pipeline, settings).ToArray()); }
public IChannel[] Start(IHandlerPipeline pipeline, BusSettings settings, OutgoingChannels channels) { return(new IChannel[0]); }