Ejemplo n.º 1
0
        public RabbitMqBusBuilder(RabbitMqHost[] hosts, IConsumePipeSpecification consumePipeSpecification, RabbitMqReceiveSettings busSettings)
            : base(consumePipeSpecification, hosts)
        {
            _hosts = hosts;

            _busEndpointConfigurator = new RabbitMqReceiveEndpointConfigurator(_hosts[0], busSettings, ConsumePipe);
        }
Ejemplo n.º 2
0
        public RabbitMqBusBuilder(RabbitMqHost[] hosts, IConsumePipeSpecification consumePipeSpecification, RabbitMqReceiveSettings busSettings)
            : base(consumePipeSpecification, hosts)
        {
            _hosts = hosts;

            _busEndpointConfigurator = new RabbitMqReceiveEndpointConfigurator(_hosts[0], busSettings, ConsumePipe);
        }
Ejemplo n.º 3
0
        public RabbitMqBusBuilder(IEnumerable <RabbitMqHost> hosts, IConsumePipeSpecification consumePipeSpecification, RabbitMqReceiveSettings busSettings)
            : base(consumePipeSpecification)
        {
            _hosts = hosts.ToArray();

            _busConsumePipe = CreateConsumePipe();

            _busEndpointConfigurator = new RabbitMqReceiveEndpointConfigurator(_hosts[0], busSettings, _busConsumePipe);
        }
Ejemplo n.º 4
0
        public RabbitMqBusBuilder(IEnumerable<RabbitMqHost> hosts, IConsumePipeSpecification consumePipeSpecification, RabbitMqReceiveSettings busSettings)
            : base(consumePipeSpecification)
        {
            _hosts = hosts.ToArray();

            _busConsumePipe = CreateConsumePipe();

            _busEndpointConfigurator = new RabbitMqReceiveEndpointConfigurator(_hosts[0], busSettings, _busConsumePipe);
        }
        public ServiceBusBusBuilder(ServiceBusHost[] hosts, IConsumePipeSpecification consumePipeSpecification, ReceiveEndpointSettings settings)
            : base(consumePipeSpecification, hosts)
        {
            if (hosts == null)
                throw new ArgumentNullException(nameof(hosts));

            _hosts = hosts;

            _busEndpointConfigurator = new ServiceBusReceiveEndpointConfigurator(_hosts[0], settings, ConsumePipe);
        }
Ejemplo n.º 6
0
        public ServiceBusBusBuilder(ServiceBusHost[] hosts, IConsumePipeSpecification consumePipeSpecification, ReceiveEndpointSettings settings)
            : base(consumePipeSpecification, hosts)
        {
            if (hosts == null)
            {
                throw new ArgumentNullException(nameof(hosts));
            }

            _hosts = hosts;

            _busEndpointConfigurator = new ServiceBusReceiveEndpointConfigurator(_hosts[0], settings, ConsumePipe);
        }
Ejemplo n.º 7
0
        public ServiceBusBusBuilder(IEnumerable<ServiceBusHost> hosts, IConsumePipeSpecification consumePipeSpecification, ReceiveEndpointSettings settings)
            : base(consumePipeSpecification)
        {
            if (hosts == null)
                throw new ArgumentNullException(nameof(hosts));

            _hosts = hosts.ToArray();

            _busConsumePipe = CreateConsumePipe();

            _busEndpointConfigurator = new ServiceBusReceiveEndpointConfigurator(_hosts[0], settings, _busConsumePipe);

            _inputAddress = _busEndpointConfigurator.InputAddress;
        }
Ejemplo n.º 8
0
        public ConsumePipe(IConsumePipeSpecification specification, IDynamicFilter <ConsumeContext, Guid> dynamicFilter, IPipe <ConsumeContext> pipe,
                           bool autoStart)
        {
            _specification = specification;
            _dynamicFilter = dynamicFilter ?? throw new ArgumentNullException(nameof(dynamicFilter));
            _pipe          = pipe ?? throw new ArgumentNullException(nameof(pipe));

            _outputPipes = new ConcurrentDictionary <Type, IMessagePipe>();
            _connected   = TaskUtil.GetTask <bool>();

            if (autoStart)
            {
                _connected.TrySetResult(true);
            }
        }
Ejemplo n.º 9
0
        public MassTransitBus(IBusHostControl host, IBusObserver busObservable, IReceiveEndpointConfiguration endpointConfiguration)
        {
            Address      = endpointConfiguration.InputAddress;
            _consumePipe = endpointConfiguration.ConsumePipe;
            _consumePipeSpecification = endpointConfiguration.Consume.Specification;
            _host            = host;
            _busObservable   = busObservable;
            _receiveEndpoint = endpointConfiguration.ReceiveEndpoint;

            Topology = host.Topology;

            _logContext = LogContext.Current;

            _publishEndpoint = new Lazy <IPublishEndpoint>(() => _receiveEndpoint.CreatePublishEndpoint(Address));
        }
Ejemplo n.º 10
0
        public InMemoryBusBuilder(IReceiveTransportProvider receiveTransportProvider,
            ISendTransportProvider sendTransportProvider, IBusHostControl[] hosts,
            IConsumePipeSpecification consumePipeSpecification)
            : base(consumePipeSpecification, hosts)
        {
            if (receiveTransportProvider == null)
                throw new ArgumentNullException(nameof(receiveTransportProvider));
            if (sendTransportProvider == null)
                throw new ArgumentNullException(nameof(sendTransportProvider));

            _busQueueName = GenerateBusQueueName();
            _inputAddress = new Uri($"loopback://localhost/{_busQueueName}");

            ReceiveTransportProvider = receiveTransportProvider;
            _sendTransportProvider = sendTransportProvider;
        }
Ejemplo n.º 11
0
        public ServiceBusBusBuilder(IEnumerable <ServiceBusHost> hosts, IConsumePipeSpecification consumePipeSpecification, ReceiveEndpointSettings settings)
            : base(consumePipeSpecification)
        {
            if (hosts == null)
            {
                throw new ArgumentNullException(nameof(hosts));
            }

            _hosts = hosts.ToArray();

            _busConsumePipe = CreateConsumePipe();

            _busEndpointConfigurator = new ServiceBusReceiveEndpointConfigurator(_hosts[0], settings, _busConsumePipe);

            _inputAddress = _busEndpointConfigurator.InputAddress;
        }
Ejemplo n.º 12
0
        public InMemoryBusBuilder(IReceiveTransportProvider receiveTransportProvider,
                                  ISendTransportProvider sendTransportProvider, IBusHostControl[] hosts,
                                  IConsumePipeSpecification consumePipeSpecification)
            : base(consumePipeSpecification, hosts)
        {
            if (receiveTransportProvider == null)
            {
                throw new ArgumentNullException(nameof(receiveTransportProvider));
            }
            if (sendTransportProvider == null)
            {
                throw new ArgumentNullException(nameof(sendTransportProvider));
            }

            _busQueueName = GenerateBusQueueName();
            _inputAddress = new Uri($"loopback://localhost/{_busQueueName}");

            ReceiveTransportProvider = receiveTransportProvider;
            _sendTransportProvider   = sendTransportProvider;
        }
Ejemplo n.º 13
0
        protected BusBuilder(IConsumePipeSpecification consumePipeSpecification)
        {
            _consumePipeSpecification = consumePipeSpecification;
            _deserializerFactories = new Dictionary<string, DeserializerFactory>(StringComparer.OrdinalIgnoreCase);
            _receiveEndpoints = new List<IReceiveEndpoint>();
            _serializerFactory = () => new JsonMessageSerializer();
            _busObservable = new BusObservable();
            _serializer = new Lazy<IMessageSerializer>(CreateSerializer);
            _deserializer = new Lazy<IMessageDeserializer>(CreateDeserializer);
            _sendTransportProvider = new Lazy<ISendTransportProvider>(CreateSendTransportProvider);
            _sendEndpointProvider = new Lazy<ISendEndpointProvider>(CreateSendEndpointProvider);
            _publishSendEndpointProvider = new Lazy<IPublishEndpointProvider>(CreatePublishSendEndpointProvider);

            _inputAddress = new Lazy<Uri>(GetInputAddress);

            AddMessageDeserializer(JsonMessageSerializer.JsonContentType,
                (s, p) => new JsonMessageDeserializer(JsonMessageSerializer.Deserializer, s, p));
            AddMessageDeserializer(BsonMessageSerializer.BsonContentType,
                (s, p) => new BsonMessageDeserializer(BsonMessageSerializer.Deserializer, s, p));
            AddMessageDeserializer(XmlMessageSerializer.XmlContentType,
                (s, p) => new XmlMessageDeserializer(JsonMessageSerializer.Deserializer, s, p));
        }
Ejemplo n.º 14
0
        protected BusBuilder(IConsumePipeSpecification consumePipeSpecification)
        {
            _consumePipeSpecification = consumePipeSpecification;
            _deserializerFactories    = new Dictionary <string, DeserializerFactory>(StringComparer.OrdinalIgnoreCase);
            _receiveEndpoints         = new List <IReceiveEndpoint>();
            _serializerFactory        = () => new JsonMessageSerializer();
            _busObservable            = new BusObservable();
            _serializer                  = new Lazy <IMessageSerializer>(CreateSerializer);
            _deserializer                = new Lazy <IMessageDeserializer>(CreateDeserializer);
            _sendTransportProvider       = new Lazy <ISendTransportProvider>(CreateSendTransportProvider);
            _sendEndpointProvider        = new Lazy <ISendEndpointProvider>(CreateSendEndpointProvider);
            _publishSendEndpointProvider = new Lazy <IPublishEndpointProvider>(CreatePublishSendEndpointProvider);

            _inputAddress = new Lazy <Uri>(GetInputAddress);

            AddMessageDeserializer(JsonMessageSerializer.JsonContentType,
                                   (s, p) => new JsonMessageDeserializer(JsonMessageSerializer.Deserializer, s, p));
            AddMessageDeserializer(BsonMessageSerializer.BsonContentType,
                                   (s, p) => new BsonMessageDeserializer(BsonMessageSerializer.Deserializer, s, p));
            AddMessageDeserializer(XmlMessageSerializer.XmlContentType,
                                   (s, p) => new XmlMessageDeserializer(JsonMessageSerializer.Deserializer, s, p));
        }
Ejemplo n.º 15
0
 public ConsumePipeConfiguration(IConsumePipeSpecification parentSpecification, IConsumePipe consumePipe = null)
     : this(consumePipe)
 {
     _specification.Connect(new ParentConsumePipeSpecificationObserver(parentSpecification));
 }
 public ParentConsumePipeSpecificationObserver(IConsumePipeSpecification specification)
 {
     _specification = specification;
 }
Ejemplo n.º 17
0
 public ImplementedMessageTypeConnector(IConsumePipeSpecification specification, MessageConsumePipeSpecification <TMessage> messageSpecification)
 {
     _specification        = specification;
     _messageSpecification = messageSpecification;
 }
Ejemplo n.º 18
0
 public ConsumePipeConfiguration(IConsumePipeSpecification parentSpecification)
 {
     _specification = new ConsumePipeSpecification();
     _specification.ConnectConsumePipeSpecificationObserver(new ParentConsumePipeSpecificationObserver(parentSpecification));
 }