.AddSingleton<IAsyncConnectionFactory, ConnectionFactory>(x =>
{
return new ConnectionFactory
{
DispatchConsumersAsync = true,
ConsumerDispatchConcurrency = 10,
// UseBackgroundThreadsForIO = true,
UserName = config.Username,
Password = config.Password,
HostName = config.Host,
Port = config.Port,
Ssl = config.SSL
? new SslOption(config.Host, enabled: true)
: new SslOption()
};
})
.AddSingleton<IAsyncConnectionFactory, ConnectionFactory>(x =>
{
return new ConnectionFactory
{
DispatchConsumersAsync = true,
ConsumerDispatchConcurrency = 10,
// UseBackgroundThreadsForIO = true,
UserName = config.Username,
Password = config.Password,
HostName = config.Host,
Port = config.Port,
Ssl = config.SSL
? new SslOption(config.Host, enabled: true)
: new SslOption()
};
})