protected BusBuilder(IConsumePipeFactory consumePipeFactory, ISendPipeFactory sendPipeFactory, IPublishPipeFactory publishPipeFactory, IEnumerable<IBusHostControl> hosts) { _consumePipeFactory = consumePipeFactory; _sendPipeFactory = sendPipeFactory; _publishPipeFactory = publishPipeFactory; _hosts = hosts.ToArray(); _deserializerFactories = new Dictionary<string, DeserializerFactory>(StringComparer.OrdinalIgnoreCase); _receiveEndpoints = new Dictionary<string, IReceiveEndpoint>(); _serializerFactory = () => new JsonMessageSerializer(); _busObservable = new BusObservable(); _serializer = new Lazy<IMessageSerializer>(CreateSerializer); _sendTransportProvider = new Lazy<ISendTransportProvider>(CreateSendTransportProvider); _inputAddress = new Lazy<Uri>(GetInputAddress); _consumePipe = new Lazy<IConsumePipe>(GetConsumePipe); 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)); }
protected BusBuilder(IConsumePipeFactory consumePipeFactory, ISendPipeFactory sendPipeFactory, IPublishPipeFactory publishPipeFactory, IEnumerable <IBusHostControl> hosts) { _consumePipeFactory = consumePipeFactory; _sendPipeFactory = sendPipeFactory; _publishPipeFactory = publishPipeFactory; _hosts = hosts.ToArray(); _deserializerFactories = new Dictionary <string, DeserializerFactory>(StringComparer.OrdinalIgnoreCase); _receiveEndpoints = new Dictionary <string, IReceiveEndpoint>(); _serializerFactory = () => new JsonMessageSerializer(); _busObservable = new BusObservable(); _serializer = new Lazy <IMessageSerializer>(CreateSerializer); _sendTransportProvider = new Lazy <ISendTransportProvider>(CreateSendTransportProvider); _inputAddress = new Lazy <Uri>(GetInputAddress); _consumePipe = new Lazy <IConsumePipe>(GetConsumePipe); 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)); }
public InMemoryBusConfiguration(IInMemoryTopologyConfiguration topologyConfiguration, Uri baseAddress) : base(topologyConfiguration) { _hostConfiguration = new InMemoryHostConfiguration(this, baseAddress, topologyConfiguration); _busEndpointConfiguration = CreateEndpointConfiguration(); _busObservers = new BusObservable(); }
public ServiceBusBusConfiguration(IServiceBusTopologyConfiguration topologyConfiguration) : base(topologyConfiguration) { HostConfiguration = new ServiceBusHostConfiguration(this, topologyConfiguration); BusEndpointConfiguration = CreateEndpointConfiguration(); _busObservers = new BusObservable(); }
public ActiveMqBusConfiguration(IActiveMqTopologyConfiguration topologyConfiguration) : base(topologyConfiguration) { HostConfiguration = new ActiveMqHostConfiguration(this, topologyConfiguration); BusEndpointConfiguration = CreateEndpointConfiguration(); _busObservers = new BusObservable(); }
public AmazonSqsBusConfiguration(IAmazonSqsTopologyConfiguration topologyConfiguration) : base(topologyConfiguration) { HostConfiguration = new AmazonSqsHostConfiguration(this, topologyConfiguration); BusEndpointConfiguration = CreateEndpointConfiguration(); _busObservers = new BusObservable(); }
public HttpBusConfiguration(IHttpTopologyConfiguration topologyConfiguration) : base(topologyConfiguration) { HostConfiguration = new HttpHostConfiguration(this, topologyConfiguration); BusEndpointConfiguration = CreateEndpointConfiguration(); _busObservers = new BusObservable(); }
public RabbitMqBusConfiguration(IRabbitMqTopologyConfiguration topologyConfiguration) : base(topologyConfiguration) { _hostConfiguration = new RabbitMqHostConfiguration(this, topologyConfiguration); _busEndpointConfiguration = CreateEndpointConfiguration(); _busObservers = new BusObservable(); }
public ConfigurationBusBuilder(IBusConfiguration configuration, IReceiveEndpointConfiguration busReceiveEndpointConfiguration, BusObservable busObservable) { _busEndpointSpecification = new ConfigurationReceiveEndpointSpecification(busReceiveEndpointConfiguration); _configuration = configuration; _busEndpointConfiguration = busReceiveEndpointConfiguration; _busObservable = busObservable; }
protected BusFactoryConfigurator(IBusConfiguration configuration, IEndpointConfiguration busEndpointConfiguration) { _configuration = configuration; _busEndpointConfiguration = busEndpointConfiguration; BusObservable = new BusObservable(); _specifications = new List <IBusFactorySpecification>(); _endpointSpecifications = new List <IReceiveEndpointSpecification <IBusBuilder> >(); }
protected BusBuilder(IBusHostCollection hosts, IEndpointConfiguration configuration) { _hosts = hosts; _configuration = configuration; _serializerBuilder = new SerializerBuilder(); _busObservable = new BusObservable(); _inputAddress = new Lazy <Uri>(GetInputAddress); _consumePipe = _configuration.Consume.CreatePipe(); }
public IBusControl Build() { try { _busEndpointConfigurator.Apply(this); return(new MassTransitBus(_busEndpointConfigurator.InputAddress, _busConsumePipe, SendEndpointProvider, PublishEndpoint, ReceiveEndpoints, _hosts, BusObservable)); } catch (Exception exception) { TaskUtil.Await(() => BusObservable.CreateFaulted(exception)); throw; } }
public GrpcBusConfiguration(IGrpcTopologyConfiguration topologyConfiguration, Uri baseAddress) : base(topologyConfiguration) { HostConfiguration = new GrpcHostConfiguration(this, baseAddress, topologyConfiguration); Serialization.ClearDeserializers(); Serialization.DefaultContentType = GrpcMessageSerializer.GrpcContentType; Serialization.AddDeserializer(GrpcMessageSerializer.GrpcContentType, () => new GrpcMessageDeserializer(GrpcMessageSerializer.Deserializer)); Serialization.SetSerializer(() => new GrpcMessageSerializer()); BusEndpointConfiguration = CreateEndpointConfiguration(); _busObservers = new BusObservable(); }
public IBusControl Build() { try { IConsumePipe busConsumePipe = CreateBusReceiveEndpoint(); return(new MassTransitBus(_inputAddress, busConsumePipe, SendEndpointProvider, PublishEndpoint, ReceiveEndpoints, _hosts, BusObservable)); } catch (Exception exception) { TaskUtil.Await(() => BusObservable.CreateFaulted(exception)); throw; } }
protected BusBuilder(IConsumePipeFactory consumePipeFactory, ISendPipeFactory sendPipeFactory, IPublishPipeFactory publishPipeFactory, IBusHostCollection hosts) { _consumePipeFactory = consumePipeFactory; _sendPipeFactory = sendPipeFactory; _publishPipeFactory = publishPipeFactory; _hosts = hosts; _serializerBuilder = new SerializerBuilder(); _busObservable = new BusObservable(); _sendTransportProvider = new Lazy<ISendTransportProvider>(CreateSendTransportProvider); _inputAddress = new Lazy<Uri>(GetInputAddress); _consumePipe = new Lazy<IConsumePipe>(GetConsumePipe); }
protected BusBuilder(IConsumePipeFactory consumePipeFactory, ISendPipeFactory sendPipeFactory, IPublishPipeFactory publishPipeFactory, IBusHostCollection hosts) { _consumePipeFactory = consumePipeFactory; _sendPipeFactory = sendPipeFactory; _publishPipeFactory = publishPipeFactory; _hosts = hosts; _serializerBuilder = new SerializerBuilder(); _busObservable = new BusObservable(); _sendTransportProvider = new Lazy <ISendTransportProvider>(CreateSendTransportProvider); _inputAddress = new Lazy <Uri>(GetInputAddress); _consumePipe = new Lazy <IConsumePipe>(GetConsumePipe); }
public IBusControl Build() { try { PreBuild(); var bus = new MassTransitBus(InputAddress, ConsumePipe, SendEndpointProvider, PublishEndpointProvider, _hosts, BusObservable); TaskUtil.Await(() => _busObservable.PostCreate(bus)); return(bus); } catch (Exception exception) { TaskUtil.Await(() => BusObservable.CreateFaulted(exception)); throw; } }
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)); }
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)); }
public ConnectHandle ConnectBusObserver(IBusObserver observer) { return(BusObservable.Connect(observer)); }