Esempio n. 1
0
 public EventDataReceiver(Uri inputAddress, IReceivePipe receivePipe, ILog log, ReceiveEndpointContext receiveTopology)
 {
     _inputAddress     = inputAddress;
     _receivePipe      = receivePipe;
     _receiveTopology  = receiveTopology;
     _receiveObservers = new ReceiveObservable();
 }
Esempio n. 2
0
 public HttpSendTransportProvider(BusHostCollection <HttpHost> hosts, IReceivePipe receivePipe, IReceiveObserver receiveObserver, IReceiveEndpointTopology topology)
 {
     _hosts           = hosts;
     _receivePipe     = receivePipe;
     _receiveObserver = receiveObserver;
     _topology        = topology;
 }
Esempio n. 3
0
 public HttpSendTransportProvider(IHttpBusConfiguration busConfiguration, IReceivePipe receivePipe, IReceiveObserver receiveObserver,
                                  ReceiveEndpointContext topology)
 {
     _busConfiguration = busConfiguration;
     _receivePipe      = receivePipe;
     _receiveObserver  = receiveObserver;
     _topology         = topology;
 }
Esempio n. 4
0
        public ReceiveEndpoint(IReceiveTransport receiveTransport, IReceivePipe receivePipe, ReceiveEndpointContext context)
        {
            _context          = context;
            _receiveTransport = receiveTransport;
            _receivePipe      = receivePipe;

            _handle = receiveTransport.ConnectReceiveTransportObserver(new Observer(this, context.EndpointObservers));
        }
 public BrokeredMessageReceiver(Uri inputAddress, IReceivePipe receivePipe, ILog log, ReceiveEndpointContext receiveTopology)
 {
     _inputAddress     = inputAddress;
     _receivePipe      = receivePipe;
     _log              = log;
     _receiveTopology  = receiveTopology;
     _receiveObservers = new ReceiveObservable();
 }
Esempio n. 6
0
        public ReceiveEndpoint(IReceiveTransport receiveTransport, IReceivePipe receivePipe)
        {
            _receiveTransport = receiveTransport;
            _receivePipe      = receivePipe;

            _observers = new ReceiveEndpointObservable();

            _handle = receiveTransport.ConnectReceiveTransportObserver(new Observer(this));
        }
Esempio n. 7
0
        public void MultiCastLevel(byte level)
        {
            _multiCastLevel = level;
            //_radio.OperatingMode = OperatingModes.StandBy;
            IReceivePipe receivePipe = _radio.ReceivePipes[0];

            receivePipe.Address = BitConverter.GetBytes(NetworkAddressing.PipeAddress(NetworkAddressing.LevelToAddress(level), 0)).ReverseBytes();
            receivePipe.Enabled = true;
            // _radio.OperatingMode = OperatingModes.ReceiveMode;
        }
Esempio n. 8
0
        public IReceiveTransport GetReceiveTransport(string queueName, IReceivePipe receivePipe, ReceiveEndpointContext topology)
        {
            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat("Creating receive transport for queue: {0}", queueName);
            }

            var queue = _messageFabric.GetQueue(queueName);

            var skippedExchange = _messageFabric.GetExchange($"{queueName}_skipped");
            var errorExchange   = _messageFabric.GetExchange($"{queueName}_error");

            var transport = new InMemoryReceiveTransport(new Uri(_baseUri, queueName), queue, receivePipe, errorExchange, skippedExchange, topology);

            Add(transport);

            return(transport);
        }
Esempio n. 9
0
        protected void ApplyReceiveEndpoint(IReceiveEndpointBuilder builder, IReceivePipe receivePipe, params IFilter <NamespaceContext>[] filters)
        {
            _sendEndpointProvider    = CreateSendEndpointProvider(builder);
            _publishEndpointProvider = CreatePublishEndpointProvider(builder);

            IPipeSpecification <NamespaceContext>[] specifications = filters
                                                                     .Concat(Enumerable.Repeat(_settings.RequiresSession
                    ? (IFilter <NamespaceContext>) new MessageSessionReceiverFilter(receivePipe, _sendEndpointProvider, _publishEndpointProvider)
                    : new MessageReceiverFilter(receivePipe, _sendEndpointProvider, _publishEndpointProvider), 1))
                                                                     .Select(x => (IPipeSpecification <NamespaceContext>) new FilterPipeSpecification <NamespaceContext>(x))
                                                                     .ToArray();

            var transport = new ReceiveTransport(Host, _settings, specifications);

            var serviceBusHost = Host as ServiceBusHost;

            if (serviceBusHost == null)
            {
                throw new ConfigurationException("Must be a ServiceBusHost");
            }

            serviceBusHost.ReceiveEndpoints.Add(_settings.Path, new ReceiveEndpoint(transport, receivePipe));
        }
Esempio n. 10
0
        public void Begin(byte channel, ushort nodeAddress)
        {
            if (!NetworkAddressing.IsValidAddress(nodeAddress))
            {
                return;
            }
            NetworkAddressing.NodeAddress = nodeAddress;
            if (channel != Configuration.UseCurrentChannel)
            {
                _radio.Configuration.Channel = channel;
            }
            _radio.RegisterContainer.EnableAutoAcknowledgementRegister.EnableAutoAcknowledgementPipe0 = false;
            _radio.RegisterContainer.EnableAutoAcknowledgementRegister.Save();

            _radio.Configuration.DynamicPayloadLengthEnabled = true;

            AutoRetransmitDelays retryVar = (AutoRetransmitDelays)((((nodeAddress % 6) + 1) * 2) + 3);

            _radio.Configuration.AutoRetransmitDelay = retryVar;
            _radio.Configuration.AutoRetransmitCount = 5;

            TransmitTimeout = 25;
            RouteTimeout    = TransmitTimeout * 3;

            NetworkAddressing.SetupAddress();

            byte i = 6;

            while (i-- > 0)
            {
                IReceivePipe receivePipe = _radio.ReceivePipes[i];
                receivePipe.Address = BitConverter.GetBytes(NetworkAddressing.PipeAddress(nodeAddress, i)).ReverseBytes();
                receivePipe.Enabled = true;
            }

            _radio.OperatingMode = OperatingModes.ReceiveMode;
        }
 public ReceivePipeDispatcher(IReceivePipe receivePipe, ReceiveObservable observers, IHostConfiguration hostConfiguration)
 {
     _receivePipe       = receivePipe;
     _observers         = observers;
     _hostConfiguration = hostConfiguration;
 }
Esempio n. 12
0
 public ReceivePipeDispatcher(IReceivePipe receivePipe, ReceiveObservable observers, ILogContext logContext)
 {
     _receivePipe = receivePipe;
     _observers   = observers;
     _logContext  = logContext;
 }
Esempio n. 13
0
 public abstract IReceiveEndpoint CreateReceiveEndpoint(string endpointName, IReceiveTransport receiveTransport, IReceivePipe receivePipe,
                                                        ReceiveEndpointContext receiveEndpointContext);
Esempio n. 14
0
 public HttpClientCache(ITaskSupervisor supervisor, IReceivePipe receivePipe)
 {
     _receivePipe    = receivePipe;
     _cacheTaskScope = supervisor.CreateScope($"{TypeMetadataCache<HttpClientCache>.ShortName}", CloseScope);
 }
Esempio n. 15
0
 public EventDataReceiver(Uri inputAddress, IReceivePipe receivePipe, ILog log, ReceiveEndpointContext receiveEndpointContext)
 {
     _inputAddress           = inputAddress;
     _receivePipe            = receivePipe;
     _receiveEndpointContext = receiveEndpointContext;
 }
 public override IReceiveEndpoint CreateReceiveEndpoint(string endpointName, IReceiveTransport receiveTransport, IReceivePipe receivePipe,
                                                        ReceiveEndpointContext topology)
 {
     throw new NotImplementedException();
 }
 public HttpSendTransportProvider(BusHostCollection <HttpHost> hosts, IReceivePipe receivePipe, IReceiveObserver receiveObserver)
 {
     _hosts           = hosts;
     _receivePipe     = receivePipe;
     _receiveObserver = receiveObserver;
 }
Esempio n. 18
0
 public HttpClientContext(HttpClient client, IReceivePipe receivePipe, ITaskScope taskScope)
     : this(client, receivePipe, taskScope.CreateParticipant($"{TypeMetadataCache<HttpClientContext>.ShortName} - {client.BaseAddress}"))
 {
 }
Esempio n. 19
0
 public ReceiveEndpoint(IReceiveTransport receiveTransport, IReceivePipe receivePipe)
 {
     _receiveTransport = receiveTransport;
     _receivePipe      = receivePipe;
 }
Esempio n. 20
0
 public HttpClientCache(IReceivePipe receivePipe)
     : base(new ClientContextFactory(receivePipe))
 {
 }
Esempio n. 21
0
 public HttpClientContext(HttpClient client, IReceivePipe receivePipe, ITaskParticipant participant)
 {
     _client      = client;
     _receivePipe = receivePipe;
     _participant = participant;
 }
 public HttpSendTransportProvider(BusHostCollection<HttpHost> hosts, IReceivePipe receivePipe, IReceiveObserver receiveObserver)
 {
     _hosts = hosts;
     _receivePipe = receivePipe;
     _receiveObserver = receiveObserver;
 }
Esempio n. 23
0
 public ClientContextFactory(IReceivePipe receivePipe)
 {
     _receivePipe = receivePipe;
 }
Esempio n. 24
0
 public HttpClientContext(HttpClient client, IReceivePipe receivePipe, CancellationToken cancellationToken)
     : base(new PayloadCache(), cancellationToken)
 {
     _client      = client;
     _receivePipe = receivePipe;
 }
 public HttpClientContextSupervisor(IReceivePipe receivePipe)
     : base(new ClientContextFactory(receivePipe))
 {
 }
Esempio n. 26
0
 public HttpClientCache(ITaskSupervisor supervisor, IReceivePipe receivePipe)
 {
     _receivePipe = receivePipe;
     _cacheTaskScope = supervisor.CreateScope($"{TypeMetadataCache<HttpClientCache>.ShortName}", CloseScope);
 }
Esempio n. 27
0
 public HttpClientContext(HttpClient client, IReceivePipe receivePipe, CancellationToken cancellationToken)
     : base(cancellationToken)
 {
     _client      = client;
     _receivePipe = receivePipe;
 }
        public override IReceiveEndpoint CreateReceiveEndpoint(string endpointName, IReceiveTransport receiveTransport, IReceivePipe receivePipe,
                                                               ReceiveEndpointContext topology)
        {
            var receiveEndpoint = new ReceiveEndpoint(receiveTransport, receivePipe, topology);

            _hostConfiguration.Host.AddReceiveEndpoint(endpointName, receiveEndpoint);

            return(receiveEndpoint);
        }
Esempio n. 29
0
 public HttpSendTransportProvider(IHttpBusConfiguration busConfiguration, IReceivePipe receivePipe, ReceiveEndpointContext receiveEndpointContext)
 {
     _busConfiguration       = busConfiguration;
     _receivePipe            = receivePipe;
     _receiveEndpointContext = receiveEndpointContext;
 }