コード例 #1
0
        public RabbitMqHost(RabbitMqHostSettings hostSettings)
        {
            _hostSettings = hostSettings;

            _connectionCache     = new RabbitMqConnectionCache(hostSettings);
            MessageNameFormatter = new RabbitMqMessageNameFormatter();
        }
コード例 #2
0
ファイル: RabbitMqHost.cs プロジェクト: kotvisbj/MassTransit
        public RabbitMqHost(RabbitMqHostSettings hostSettings)
        {
            _hostSettings = hostSettings;

            _connectionCache = new RabbitMqConnectionCache(hostSettings);
            MessageNameFormatter = new RabbitMqMessageNameFormatter();
        }
コード例 #3
0
        public RabbitMqOptionSet()
        {
            Add<string>("h|host:", "The host name of the broker", x => Host = x);
            Add<string>("vhost:", "The virtual host to use", value => VirtualHost = value);
            Add<string>("u|username:"******"Username (if using basic credentials)", value => Username = value);
            Add<string>("p|password:"******"Password (if using basic credentials)", value => Password = value);
            Add<ushort>("heartbeat:", "Heartbeat (for RabbitMQ)", value => Heartbeat = value);

            Host = "localhost";
            Username = "******";
            Password = "******";
            Heartbeat = 0;
            VirtualHost = "/";
            Port = 5672;

            Ssl = false;
            SslProtocol = SslProtocols.Tls12;
            SslServerName = Host;
            AcceptablePolicyErrors = SslPolicyErrors.RemoteCertificateNameMismatch;
            ClientCertificatePath = "";
            ClientCertificatePassphrase = "";

            MessageNameFormatter = new RabbitMqMessageNameFormatter();

            PublisherConfirmation = true;
        }
コード例 #4
0
        public RabbitMqHost(RabbitMqHostSettings hostSettings)
        {
            _hostSettings = hostSettings;

            MessageNameFormatter = new RabbitMqMessageNameFormatter();

            var exceptionFilter = Retry.Selected <RabbitMqConnectionException>();

            _connectionRetryPolicy = exceptionFilter.Exponential(1000, TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(1));

            _supervisor = new TaskSupervisor($"{TypeMetadataCache<RabbitMqHost>.ShortName} - {_hostSettings.ToDebugString()}");

            _connectionCache = new RabbitMqConnectionCache(hostSettings, _supervisor);
        }