Exemple #1
0
        protected override void ConfigureSettings(ITransceiverConnectionSettings connectionSettings)
        {
            _subscriberSettings = connectionSettings.RpcServerReceiver;

            var transmitterSettings = connectionSettings.RpcServerTransmitter;

            _transmitterConnectionString = $"Endpoint=sb://{transmitterSettings.AccountId}.servicebus.windows.net/;SharedAccessKeyName={transmitterSettings.UserName};SharedAccessKey={transmitterSettings.AccessKey};";
        }
Exemple #2
0
 public ProxyFactory(
     ITransceiverConnectionSettings connectionSettings,
     ITransceiver client,
     IAsyncCoupler <IMessage> asyncCoupler,
     ILogger logger)
 {
     _connectionSettings = connectionSettings ?? throw new ArgumentNullException(nameof(connectionSettings));
     _client             = client ?? throw new ArgumentNullException(nameof(client));
     _asyncCoupler       = asyncCoupler ?? throw new ArgumentNullException(nameof(asyncCoupler));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
 }
        protected override void ConfigureSettings(ITransceiverConnectionSettings settings)
        {
            _topicConstructorSettings = settings.RpcAdmin;
            _subscriberSettings       = settings.RpcClientReceiver;

            // Endpoint - AccountId
            // SharedAccessKeyName - UserName
            // SharedAccessKey - AccessKey
            // DestinationEntityPath - ResourceName
            var transmitterSettings = settings.RpcClientTransmitter;

            _transmitterConnectionSettings = $"Endpoint=sb://{transmitterSettings.AccountId}.servicebus.windows.net/;SharedAccessKeyName={transmitterSettings.UserName};SharedAccessKey={transmitterSettings.AccessKey};";
            _serverTopicPrefix             = transmitterSettings.ResourceName;
        }
Exemple #4
0
        public async Task StartAsync(ITransceiverConnectionSettings connectionSettings)
        {
            if (connectionSettings == null)
            {
                throw new ArgumentNullException(nameof(connectionSettings));
            }
            ConfigureSettings(connectionSettings);

            if (IsRunning)
            {
                return;
            }

            await CustomStartAsync();

            IsRunning = true;
        }
Exemple #5
0
        internal static TProxyInterface Create <TProxyInterface>(
            ITransceiverConnectionSettings connectionSettings,
            ITransceiver client,
            IAsyncCoupler <IMessage> asyncCoupler,
            ILogger logger,
            IProxySettings proxySettings) where TProxyInterface : class
        {
            var result = Create <TProxyInterface, Proxy>();

            var proxy = (result as Proxy);

            proxy._connectionSettings = connectionSettings ?? throw new ArgumentNullException(nameof(connectionSettings));
            proxy._client             = client ?? throw new ArgumentNullException(nameof(client));
            proxy._asyncCoupler       = asyncCoupler ?? throw new ArgumentNullException(nameof(asyncCoupler));
            proxy._logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            proxy._proxySettings      = proxySettings ?? throw new ArgumentNullException(nameof(proxySettings));
            if (string.IsNullOrEmpty(proxySettings.OrganizationId))
            {
                throw new ArgumentNullException(nameof(proxySettings.OrganizationId));
            }

            if (string.IsNullOrEmpty(proxySettings.InstanceId))
            {
                throw new ArgumentNullException(nameof(proxySettings.InstanceId));
            }

            if (string.IsNullOrEmpty(connectionSettings.RpcClientReceiver.ResourceName))
            {
                throw new ArgumentNullException(nameof(connectionSettings.RpcClientReceiver.ResourceName));
            }

            proxy._replyPath = connectionSettings.RpcClientReceiver.ResourceName;
            if (connectionSettings.RpcClientTransmitter.TimeoutInSeconds == 0)
            {
                throw new ArgumentException("timeout must be  greater than zero", nameof(connectionSettings.RpcClientReceiver.TimeoutInSeconds));
            }

            proxy._requestTimeout = TimeSpan.FromSeconds(connectionSettings.RpcClientTransmitter.TimeoutInSeconds);

            return(result);
        }
 protected override void ConfigureSettings(ITransceiverConnectionSettings settings)
 {
 }
 protected override void UpdateSettings(ITransceiverConnectionSettings settings)
 {
 }
Exemple #8
0
 public Task RefreshConnection(ITransceiverConnectionSettings connectionSettings)
 {
     ConfigureSettings(connectionSettings);
     return(Task.FromResult(default(object)));
 }
Exemple #9
0
 protected abstract void ConfigureSettings(ITransceiverConnectionSettings settings);
 protected override void ConfigureSettings(ITransceiverConnectionSettings settings)
 {
     throw new NotImplementedException();
 }
Exemple #11
0
 protected abstract void UpdateSettings(ITransceiverConnectionSettings settings);