Closed ghost closed 3 years ago
Hello, I'm receiving errors when replicating sslProducer example - https://github.com/AntonyVorontsov/RabbitMQ.Client.Core.DependencyInjection/blob/master/examples/Examples.SslProducer/appsettings.json on my end.
errors are occurred at this line - `IConfigurationSection rabbitMqSection = _configuration.GetSection("RabbitMq"); IConfigurationSection exchangeSection = _configuration.GetSection("RabbitMqExchange"); string exchangeName = exchangeSection.GetSection("Name").Value; string routingKey = exchangeSection.GetSection("Queues:0:RoutingKeys:0").Value;
IServiceCollection services = new ServiceCollection(); services.AddLogging(builder => builder.AddConsole()); services.AddRabbitMqClient(rabbitMqSection) .AddProductionExchange(exchangeName, exchangeSection); IServiceProvider sp = services.BuildServiceProvider(); IQueueService queueService = sp.GetRequiredService<IQueueService>(); ///// errors were thrown here await PublishMessagesAsync(queueService, exchangeName, routingKey); Console.ReadLine();`
errors are following
here is my appsettings - "RabbitMq": { "TcpEndpoints": [ { "HostName": "xxx.xx.xxx.152", "Port": 5671, "SslOption": { "Enabled": true, "ServerName": "server-name", "CertificatePath": "C:/Users/username/client/client_certificate.p12", "CertificatePassphrase": "MySecretPassword", "AcceptablePolicyErrors": "RemoteCertificateChainErrors, RemoteCertificateNameMismatch" } } ], "UserName": "guest", "Password": "guest" }, "RabbitMqExchange": { "Name": "Test2.Exchange", "Type": "fanout", "Durable": true, "Queues": [ { "Name": "test-queue", "Durable": true, "RoutingKeys": [ "test-queue_key" ] }, { "Name": "test2-queue", "Durable": true, "RoutingKeys": [ "test-queue_key" ] } ] }
"RabbitMq": { "TcpEndpoints": [ { "HostName": "xxx.xx.xxx.152", "Port": 5671, "SslOption": { "Enabled": true, "ServerName": "server-name", "CertificatePath": "C:/Users/username/client/client_certificate.p12", "CertificatePassphrase": "MySecretPassword", "AcceptablePolicyErrors": "RemoteCertificateChainErrors, RemoteCertificateNameMismatch" } } ], "UserName": "guest", "Password": "guest" }, "RabbitMqExchange": { "Name": "Test2.Exchange", "Type": "fanout", "Durable": true, "Queues": [ { "Name": "test-queue", "Durable": true, "RoutingKeys": [ "test-queue_key" ] }, { "Name": "test2-queue", "Durable": true, "RoutingKeys": [ "test-queue_key" ] } ] }
please advice what to do.
@AntonyVorontsov please advise on this issue.
Hello, I'm receiving errors when replicating sslProducer example - https://github.com/AntonyVorontsov/RabbitMQ.Client.Core.DependencyInjection/blob/master/examples/Examples.SslProducer/appsettings.json on my end.
errors are occurred at this line - `IConfigurationSection rabbitMqSection = _configuration.GetSection("RabbitMq"); IConfigurationSection exchangeSection = _configuration.GetSection("RabbitMqExchange"); string exchangeName = exchangeSection.GetSection("Name").Value; string routingKey = exchangeSection.GetSection("Queues:0:RoutingKeys:0").Value;
errors are following
here is my appsettings -
"RabbitMq": { "TcpEndpoints": [ { "HostName": "xxx.xx.xxx.152", "Port": 5671, "SslOption": { "Enabled": true, "ServerName": "server-name", "CertificatePath": "C:/Users/username/client/client_certificate.p12", "CertificatePassphrase": "MySecretPassword", "AcceptablePolicyErrors": "RemoteCertificateChainErrors, RemoteCertificateNameMismatch" } } ], "UserName": "guest", "Password": "guest" }, "RabbitMqExchange": { "Name": "Test2.Exchange", "Type": "fanout", "Durable": true, "Queues": [ { "Name": "test-queue", "Durable": true, "RoutingKeys": [ "test-queue_key" ] }, { "Name": "test2-queue", "Durable": true, "RoutingKeys": [ "test-queue_key" ] } ] }
please advice what to do.