public ISendTransport CreateSendTransport(IModelContextSupervisor modelContextSupervisor, IFilter <ModelContext> modelFilter, string exchangeName)
        {
            var transport = new RabbitMqSendTransport(modelContextSupervisor, modelFilter, exchangeName);

            _host.Add(transport);

            return(transport);
        }
        ISendTransport CreateSendTransport(IModelContextSupervisor modelContextSupervisor, IPipe <ModelContext> pipe, string exchangeName)
        {
            var sendTransportContext = new SendTransportContext(modelContextSupervisor, pipe, exchangeName, _hostConfiguration.SendLogContext);

            var transport = new RabbitMqSendTransport(sendTransportContext);

            Add(transport);

            return(transport);
        }
        Task <ISendTransport> CreateSendTransport(IModelContextSupervisor modelContextSupervisor, IPipe <ModelContext> pipe, string exchangeName)
        {
            var sendTransportContext = new SendTransportContext(_hostConfiguration, modelContextSupervisor, pipe, exchangeName);

            var transport = new RabbitMqSendTransport(sendTransportContext);

            AddSendAgent(transport);

            return(Task.FromResult <ISendTransport>(transport));
        }
        Task<ISendEndpoint> CreateSendEndpoint(Type messageType)
        {
            SendSettings sendSettings = _host.GetSendSettings(messageType);

            ExchangeBindingSettings[] bindings = TypeMetadataCache.GetMessageTypes(messageType)
                .SelectMany(type => type.GetExchangeBindings(_host.MessageNameFormatter))
                .Where(binding => !sendSettings.ExchangeName.Equals(binding.Exchange.ExchangeName))
                .ToArray();

            Uri destinationAddress = _host.Settings.GetSendAddress(sendSettings);

            var modelCache = new RabbitMqModelCache(_host.ConnectionCache);

            var sendTransport = new RabbitMqSendTransport(modelCache, sendSettings, bindings);

            return Task.FromResult<ISendEndpoint>(new SendEndpoint(sendTransport, _serializer, destinationAddress, _sourceAddress, SendPipe.Empty));
        }
Esempio n. 5
0
        Task <ISendTransport> CreateSendTransport(IModelContextSupervisor modelContextSupervisor, IPipe <ModelContext> pipe, string exchangeName,
                                                  RabbitMqEndpointAddress endpointAddress)
        {
            var supervisor = new ModelContextSupervisor(modelContextSupervisor);

            var delayedExchangeAddress = endpointAddress.GetDelayAddress();

            var delaySettings = new RabbitMqDelaySettings(delayedExchangeAddress);

            delaySettings.BindToExchange(exchangeName);

            IPipe <ModelContext> delayPipe = new ConfigureTopologyFilter <DelaySettings>(delaySettings, delaySettings.GetBrokerTopology()).ToPipe();

            var sendTransportContext = new SendTransportContext(_hostConfiguration, supervisor, pipe, exchangeName, delayPipe, delaySettings.ExchangeName);

            var transport = new RabbitMqSendTransport(sendTransportContext);

            modelContextSupervisor.AddSendAgent(transport);

            return(Task.FromResult <ISendTransport>(transport));
        }