示例#1
0
 public ServiceBusPublishEndpointProvider(IServiceBusHost host, ISendEndpointProvider sendEndpointProvider)
 {
     _host = host;
     _sendEndpointProvider = sendEndpointProvider;
     _nameFormatter        = host.MessageNameFormatter;
     _publishObservable    = new PublishObservable();
 }
示例#2
0
            public MessagePipe(PublishObservable observer)
            {
                _filter   = new Lazy <IFilter <PublishContext> >(CreateFilter);
                _observer = observer;

                _pipeFilters = new List <IFilter <PublishContext <TMessage> > >();
            }
示例#3
0
 public InMemoryPublishEndpointProvider(ISendEndpointProvider sendEndpointProvider, ISendTransportProvider transportProvider, IPublishPipe publishPipe)
 {
     _sendEndpointProvider = sendEndpointProvider;
     _publishPipe          = publishPipe;
     _host = transportProvider as InMemoryHost;
     _publishObservable = new PublishObservable();
 }
 public InMemoryPublishEndpointProvider(ISendEndpointProvider sendEndpointProvider, ISendTransportProvider transportProvider, IPublishPipe publishPipe)
 {
     _sendEndpointProvider = sendEndpointProvider;
     _publishPipe = publishPipe;
     _transportCache = transportProvider as InMemoryTransportCache;
     _publishObservable = new PublishObservable();
 }
示例#5
0
        public PublishSendEndpoint(ISendEndpoint endpoint, IPublishPipe publishPipe)
        {
            _endpoint    = endpoint;
            _publishPipe = publishPipe;

            _observers = new PublishObservable();
        }
 public ServiceBusPublishEndpointProvider(IServiceBusHost host, ISendEndpointProvider sendEndpointProvider)
 {
     _host = host;
     _sendEndpointProvider = sendEndpointProvider;
     _nameFormatter = host.MessageNameFormatter;
     _publishObservable = new PublishObservable();
 }
        protected BaseReceiveEndpointContext(IHostConfiguration hostConfiguration, IReceiveEndpointConfiguration configuration)
        {
            InputAddress = configuration.InputAddress;
            HostAddress  = configuration.HostAddress;

            _publishTopology = configuration.Topology.Publish;

            ConsumePipeSpecification = configuration.Consume.Specification;

            _logContext = LogContext.Current.CreateLogContext(LogCategoryName.Transport.Receive);

            SendObservers    = new SendObservable();
            PublishObservers = new PublishObservable();

            _endpointObservers  = configuration.EndpointObservers;
            _receiveObservers   = configuration.ReceiveObservers;
            _transportObservers = configuration.TransportObservers;

            Dependencies = configuration.Dependencies;

            _sendPipe    = new Lazy <ISendPipe>(() => configuration.Send.CreatePipe());
            _publishPipe = new Lazy <IPublishPipe>(() => configuration.Publish.CreatePipe());
            _receivePipe = new Lazy <IReceivePipe>(configuration.CreateReceivePipe);

            _serializer               = new Lazy <IMessageSerializer>(() => configuration.Serialization.Serializer);
            _sendEndpointProvider     = new Lazy <ISendEndpointProvider>(CreateSendEndpointProvider);
            _publishEndpointProvider  = new Lazy <IPublishEndpointProvider>(CreatePublishEndpointProvider);
            _sendTransportProvider    = new Lazy <ISendTransportProvider>(CreateSendTransportProvider);
            _publishTransportProvider = new Lazy <IPublishTransportProvider>(CreatePublishTransportProvider);

            hostConfiguration.ConnectReceiveContextContext(this);
        }
        protected BaseReceiveEndpointContext(IHostConfiguration hostConfiguration, IReceiveEndpointConfiguration configuration)
        {
            _hostConfiguration = hostConfiguration;

            InputAddress           = configuration.InputAddress;
            HostAddress            = configuration.HostAddress;
            PublishFaults          = configuration.PublishFaults;
            PrefetchCount          = configuration.PrefetchCount;
            ConcurrentMessageLimit = configuration.ConcurrentMessageLimit;

            _publishTopology = configuration.Topology.Publish;

            ConsumePipeSpecification = configuration.Consume.Specification;

            SendObservers    = new SendObservable();
            PublishObservers = new PublishObservable();

            _endpointObservers  = configuration.EndpointObservers;
            _receiveObservers   = configuration.ReceiveObservers;
            _transportObservers = configuration.TransportObservers;

            Dependencies = configuration.Dependencies;

            _sendPipe    = new Lazy <ISendPipe>(() => configuration.Send.CreatePipe());
            _publishPipe = new Lazy <IPublishPipe>(() => configuration.Publish.CreatePipe());
            _receivePipe = new Lazy <IReceivePipe>(configuration.CreateReceivePipe);

            _serializer = new Lazy <IMessageSerializer>(() => configuration.Serialization.Serializer);

            Reset();

            hostConfiguration.ConnectReceiveEndpointContext(this);
        }
        public MediatorPublishSendEndpoint(ISendEndpoint endpoint, IPublishPipe publishPipe)
            : base(endpoint)
        {
            _publishPipe = publishPipe;

            _observers = new PublishObservable();
        }
示例#10
0
            public MessagePipe(PublishObservable observers, IMessagePublishPipeSpecification <TMessage> specification)

            {
                _output = new Lazy <IMessagePublishPipe <TMessage> >(CreateFilter);

                _observers     = observers;
                _specification = specification;
            }
示例#11
0
        public HttpPublishEndpointProvider(Uri hostAddress, IMessageSerializer serializer, ISendTransportProvider transportProvider, IPublishPipe publishPipe)
        {
            _hostAddress       = hostAddress;
            _serializer        = serializer;
            _transportProvider = transportProvider;
            _publishPipe       = publishPipe;

            _publishObservable = new PublishObservable();
        }
 public RabbitMqPublishEndpointProvider(IRabbitMqHost host, IMessageSerializer serializer, Uri sourceAddress, IPublishPipe publishPipe)
 {
     _host = host;
     _serializer = serializer;
     _sourceAddress = sourceAddress;
     _publishPipe = publishPipe;
     _cachedEndpoints = new LazyConcurrentDictionary<Type, ISendEndpoint>(CreateSendEndpoint);
     _publishObservable = new PublishObservable();
 }
示例#13
0
 public RabbitMqPublishEndpointProvider(IRabbitMqHost host, IMessageSerializer serializer, Uri sourceAddress)
 {
     _host                 = host;
     _serializer           = serializer;
     _sourceAddress        = sourceAddress;
     _messageNameFormatter = host.MessageNameFormatter;
     _cachedEndpoints      = new ConcurrentDictionary <Type, Lazy <ISendEndpoint> >();
     _publishObservable    = new PublishObservable();
 }
示例#14
0
 public PublishEndpoint(Uri sourceAddress, IPublishEndpointProvider endpointProvider, PublishObservable publishObserver, IPublishPipe publishPipe,
                        ConsumeContext consumeContext)
 {
     _sourceAddress    = sourceAddress;
     _endpointProvider = endpointProvider;
     _publishObserver  = publishObserver;
     _publishPipe      = publishPipe;
     _consumeContext   = consumeContext;
 }
 public RabbitMqPublishEndpointProvider(IRabbitMqHost host, IMessageSerializer serializer, Uri sourceAddress)
 {
     _host = host;
     _serializer = serializer;
     _sourceAddress = sourceAddress;
     _messageNameFormatter = host.MessageNameFormatter;
     _cachedEndpoints = new ConcurrentDictionary<Type, Lazy<ISendEndpoint>>();
     _publishObservable = new PublishObservable();
 }
示例#16
0
        public HttpPublishEndpointProvider(IHttpHost host, IMessageSerializer serializer, ISendTransportProvider transportProvider, IPublishPipe publishPipe)
        {
            _host              = host;
            _serializer        = serializer;
            _transportProvider = transportProvider;
            _publishPipe       = publishPipe;

            _publishObservable = new PublishObservable();
        }
示例#17
0
 public PublishEndpointPipeAdapter(T message, IPublishPipe publishPipe, PublishObservable observer, Uri sourceAddress, ConsumeContext consumeContext)
 {
     _message        = message;
     _pipe           = Pipe.Empty <PublishContext <T> >();
     _publishPipe    = publishPipe;
     _observer       = observer;
     _sourceAddress  = sourceAddress;
     _consumeContext = consumeContext;
 }
示例#18
0
 public RabbitMqPublishEndpointProvider(IRabbitMqHost host, IMessageSerializer serializer, Uri sourceAddress, IPublishPipe publishPipe)
 {
     _host              = host;
     _serializer        = serializer;
     _sourceAddress     = sourceAddress;
     _publishPipe       = publishPipe;
     _cachedEndpoints   = new LazyConcurrentDictionary <Type, ISendEndpoint>(CreateSendEndpoint);
     _publishObservable = new PublishObservable();
 }
 public ReceiveEndpointCollection()
 {
     _endpoints                = new Dictionary <string, IReceiveEndpointControl>(StringComparer.OrdinalIgnoreCase);
     _handles                  = new Dictionary <string, HostReceiveEndpointHandle>(StringComparer.OrdinalIgnoreCase);
     _receiveObservers         = new ReceiveObservable();
     _receiveEndpointObservers = new ReceiveEndpointObservable();
     _consumeObservers         = new ConsumeObservable();
     _publishObservers         = new PublishObservable();
     _sendObservers            = new SendObservable();
 }
        public HttpPublishEndpointProvider(IHttpHost host, IMessageSerializer serializer, ISendTransportProvider transportProvider, IPublishPipe publishPipe,
            ISendPipe sendPipe)
        {
            _host = host;
            _serializer = serializer;
            _transportProvider = transportProvider;
            _publishPipe = publishPipe;
            _sendPipe = sendPipe;

            _publishObservable = new PublishObservable();
        }
示例#21
0
        protected BaseHostConfiguration(IBusConfiguration busConfiguration)
        {
            BusConfiguration = busConfiguration;
            _endpoints       = new List <TConfiguration>();

            _endpointObservable = new EndpointConfigurationObservable();

            _receiveObservers = new ReceiveObservable();
            _consumeObservers = new ConsumeObservable();
            _publishObservers = new PublishObservable();
            _sendObservers    = new SendObservable();
        }
示例#22
0
        public RabbitMqPublishEndpointProvider(IRabbitMqHost host, IMessageSerializer serializer, Uri sourceAddress, IPublishPipe publishPipe)
        {
            _host          = host;
            _serializer    = serializer;
            _sourceAddress = sourceAddress;
            _publishPipe   = publishPipe;

            _publishObservable = new PublishObservable();

            var cache = new GreenCache <CachedSendEndpoint <Type> >(10000, TimeSpan.FromMinutes(1), TimeSpan.FromHours(24), () => DateTime.UtcNow);

            _index = cache.AddIndex("type", x => x.Key);
        }
示例#23
0
        public RabbitMqPublishEndpointProvider(IRabbitMqHost host, IMessageSerializer serializer, Uri sourceAddress, IPublishPipe publishPipe)
        {
            _host          = host;
            _serializer    = serializer;
            _sourceAddress = sourceAddress;
            _publishPipe   = publishPipe;

            _publishObservable = new PublishObservable();

            var cacheId = NewId.NextGuid().ToString();

            _cache = new LazyMemoryCache <Type, ISendEndpoint>(cacheId, CreateSendEndpoint, GetEndpointCachePolicy, FormatAddressKey,
                                                               OnCachedEndpointRemoved);
        }
示例#24
0
        public InMemoryPublishEndpointProvider(ISendTransportProvider transportProvider, IPublishPipe publishPipe, IInMemoryPublishTopology publishTopology,
                                               IMessageSerializer serializer, Uri sourceAddress)
        {
            _publishPipe       = publishPipe;
            _publishTopology   = publishTopology;
            _serializer        = serializer;
            _sourceAddress     = sourceAddress;
            _host              = transportProvider as InMemoryHost;
            _publishObservable = new PublishObservable();

            var cache = new GreenCache <CachedSendEndpoint <TypeKey> >(10000, TimeSpan.FromMinutes(1), TimeSpan.FromHours(24), () => DateTime.UtcNow);

            _index = cache.AddIndex("type", x => x.Key);
        }
示例#25
0
        public PublishEndpointProvider(IPublishTransportProvider transportProvider, Uri hostAddress, PublishObservable publishObservers,
                                       IMessageSerializer serializer, Uri sourceAddress, IPublishPipe publishPipe, IPublishTopology publishTopology)
        {
            _transportProvider = transportProvider;
            _hostAddress       = hostAddress;
            _serializer        = serializer;
            _sourceAddress     = sourceAddress;
            _publishPipe       = publishPipe;
            _publishTopology   = publishTopology;

            _publishObservers = publishObservers;

            _cache = new SendEndpointCache <Type>();
        }
示例#26
0
        public ServiceBusPublishEndpointProvider(IServiceBusHost host, ISendEndpointProvider sendEndpointProvider, IPublishPipe publishPipe,
                                                 IServiceBusPublishTopology publishTopology, IMessageSerializer serializer, Uri sourceAddress)
        {
            _host            = host;
            _publishPipe     = publishPipe;
            _publishTopology = publishTopology;
            _serializer      = serializer;
            _sourceAddress   = sourceAddress;

            _endpointCache = new SendEndpointCache(sendEndpointProvider);

            _publishObservable = new PublishObservable();
            _sendObservable    = new SendObservable();
        }
        MediatorPublishEndpoint(IReceiveEndpointConfiguration configuration, IReceivePipeDispatcher dispatcher, ILogContext logContext,
                                SendObservable sendObservers)
        {
            _dispatcher    = dispatcher;
            _logContext    = logContext;
            _sendObservers = sendObservers;

            _destinationAddress = configuration.InputAddress;
            _publishTopology    = configuration.Topology.Publish;
            _receiveObservers   = configuration.ReceiveObservers;

            _publishPipe = configuration.Publish.CreatePipe();

            _observers = new PublishObservable();
        }
        protected BaseReceiveEndpointContext(IReceiveEndpointConfiguration configuration, ReceiveObservable receiveObservers,
                                             ReceiveTransportObservable transportObservers, ReceiveEndpointObservable endpointObservers)
        {
            InputAddress = configuration.InputAddress;
            HostAddress  = configuration.HostAddress;

            _send    = configuration.Topology.Send;
            _publish = configuration.Topology.Publish;

            SendObservers     = new SendObservable();
            PublishObservers  = new PublishObservable();
            EndpointObservers = endpointObservers;

            ReceiveObservers   = receiveObservers;
            TransportObservers = transportObservers;

            _sendPipe    = new Lazy <ISendPipe>(() => configuration.Send.CreatePipe());
            _publishPipe = new Lazy <IPublishPipe>(() => configuration.Publish.CreatePipe());

            _serializer              = new Lazy <IMessageSerializer>(() => configuration.Serialization.Serializer);
            _sendEndpointProvider    = new Lazy <ISendEndpointProvider>(CreateSendEndpointProvider);
            _publishEndpointProvider = new Lazy <IPublishEndpointProvider>(CreatePublishEndpointProvider);
        }
        protected BaseReceiveEndpointContext(IReceiveEndpointConfiguration configuration)
        {
            InputAddress = configuration.InputAddress;
            HostAddress  = configuration.HostAddress;

            _publishTopology = configuration.Topology.Publish;

            SendObservers    = new SendObservable();
            PublishObservers = new PublishObservable();

            _endpointObservers  = configuration.EndpointObservers;
            _receiveObservers   = configuration.ReceiveObservers;
            _transportObservers = configuration.TransportObservers;

            _sendPipe    = new Lazy <ISendPipe>(() => configuration.Send.CreatePipe());
            _publishPipe = new Lazy <IPublishPipe>(() => configuration.Publish.CreatePipe());
            _receivePipe = new Lazy <IReceivePipe>(configuration.CreateReceivePipe);

            _serializer               = new Lazy <IMessageSerializer>(() => configuration.Serialization.Serializer);
            _sendEndpointProvider     = new Lazy <ISendEndpointProvider>(CreateSendEndpointProvider);
            _publishEndpointProvider  = new Lazy <IPublishEndpointProvider>(CreatePublishEndpointProvider);
            _sendTransportProvider    = new Lazy <ISendTransportProvider>(CreateSendTransportProvider);
            _publishTransportProvider = new Lazy <IPublishTransportProvider>(CreatePublishTransportProvider);
        }
 public InMemoryPublishEndpointProvider(ISendEndpointProvider sendEndpointProvider, ISendTransportProvider transportProvider)
 {
     _sendEndpointProvider = sendEndpointProvider;
     _transportCache       = transportProvider as InMemoryTransportCache;
     _publishObservable    = new PublishObservable();
 }
示例#31
0
 public PublishPipe(IPublishPipeSpecification specification)
 {
     _specification = specification;
     _outputPipes   = new ConcurrentDictionary <Type, IMessagePipe>();
     _observers     = new PublishObservable();
 }
示例#32
0
 public MessageTypePublishFilter()
 {
     _pipes     = new ConcurrentDictionary <Type, IMessagePipe>();
     _observers = new PublishObservable();
 }
示例#33
0
 public HttpClientPublishEndpointProvider()
 {
     _observers = new PublishObservable();
 }