public ServiceBusOptionSet()
        {
            Add<string>("ns=", "The service bus namespace",
                x => ServiceUri = ServiceBusEnvironment.CreateServiceUri("sb", x, "Benchmark"));
            Add<string>("keyname=", "The access key name", x => _keyName = x);
            Add<string>("key=", "The access key", x => _accessKey = x);
            Add<int>("connections=", "The number of connections to configure for the service point manager",
                x => DefaultConnections = x);

            _tokenTimeToLive = TimeSpan.FromDays(1);
            _tokenScope = TokenScope.Namespace;

            OperationTimeout = TimeSpan.FromSeconds(60.0);
            RetryMinBackoff = TimeSpan.FromMilliseconds(100.0);
            RetryMaxBackoff = TimeSpan.FromSeconds(20.0);
            RetryLimit = 10;
            TransportType = Microsoft.ServiceBus.Messaging.TransportType.Amqp;
            AmqpTransportSettings = new AmqpTransportSettings
            {
                BatchFlushInterval = TimeSpan.FromMilliseconds(3.0)
            };
            NetMessagingTransportSettings = new NetMessagingTransportSettings
            {
                BatchFlushInterval = TimeSpan.FromMilliseconds(3.0)
            };

            DefaultConnections = ServicePointManager.DefaultConnectionLimit;
        }
 /// <inheritdoc />
 public virtual IServiceBusHostBuilder UseNetMessaging(NetMessagingTransportSettings settings)
 {
     _hostConfiguratorActions.Add(configure =>
     {
         configure.TransportType = TransportType.NetMessaging;
         configure.NetMessagingTransportSettings = settings;
         configure.AmqpTransportSettings         = null;
     });
     return(this);
 }
            public HostSettings(Uri serviceUri)
            {
                ServiceUri = serviceUri;
                OperationTimeout = TimeSpan.FromSeconds(60);

                RetryMinBackoff = TimeSpan.FromMilliseconds(100);
                RetryMaxBackoff = TimeSpan.FromSeconds(20);
                RetryLimit = 10;
                TransportType = TransportType.Amqp;
                AmqpTransportSettings = new AmqpTransportSettings() { BatchFlushInterval = TimeSpan.FromMilliseconds(50), };
                NetMessagingTransportSettings = new NetMessagingTransportSettings() { BatchFlushInterval = TimeSpan.FromMilliseconds(50), };
            }
예제 #4
0
        public HostSettings()
        {
            OperationTimeout = TimeSpan.FromSeconds(60);

            RetryMinBackoff = TimeSpan.FromMilliseconds(100);
            RetryMaxBackoff = TimeSpan.FromSeconds(30);
            RetryLimit      = 10;

            TransportType                 = TransportType.Amqp;
            AmqpTransportSettings         = new AmqpTransportSettings();
            NetMessagingTransportSettings = new NetMessagingTransportSettings();
        }
        public SbmpMessagingFactory(IEnumerable <Uri> baseAddresses, NetMessagingTransportSettings settings)
        {
            bool             flag;
            ConnectivityMode systemConnectivityMode = ConnectivityModeHelper.SystemConnectivityMode;

            this.connectionId = Guid.NewGuid().ToString("N");
            this.Settings     = (NetMessagingTransportSettings)settings.Clone();
            if (systemConnectivityMode == ConnectivityMode.AutoDetect && !this.Settings.GatewayMode)
            {
                this.baseAddresses      = new List <Uri>(baseAddresses);
                this.FirstInBaseAddress = this.baseAddresses.First <Uri>();
                return;
            }
            flag = (systemConnectivityMode != ConnectivityMode.Http ? false : true);
            this.Initialize(flag, baseAddresses);
        }
            public HostSettings(Uri serviceUri)
            {
                ServiceUri       = serviceUri;
                OperationTimeout = TimeSpan.FromSeconds(60);

                RetryMinBackoff       = TimeSpan.FromMilliseconds(100);
                RetryMaxBackoff       = TimeSpan.FromSeconds(20);
                RetryLimit            = 10;
                TransportType         = TransportType.Amqp;
                AmqpTransportSettings = new AmqpTransportSettings()
                {
                    BatchFlushInterval = TimeSpan.FromMilliseconds(50),
                };
                NetMessagingTransportSettings = new NetMessagingTransportSettings()
                {
                    BatchFlushInterval = TimeSpan.FromMilliseconds(50),
                };
            }
 internal void InitializeFrom(NetMessagingTransportSettings settings)
 {
     this.BatchFlushInterval = settings.BatchFlushInterval;
     this.EnableRedirect     = settings.EnableRedirect;
 }
 internal void ApplyTo(NetMessagingTransportSettings settings)
 {
     settings.BatchFlushInterval = this.BatchFlushInterval;
     settings.EnableRedirect     = this.EnableRedirect;
 }
 public SbmpMessagingFactory(Uri baseAddress, NetMessagingTransportSettings settings) : this(new List <Uri>()
 {
     baseAddress
 }, settings)
 {
 }