Skip to content

Commit 97aeb84

Browse files
authored
When configuring a cluster using RabbitMQ, SSL configuration items configured in the factory are preferred. (#1734)
1 parent a65150a commit 97aeb84

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/DotNetCore.CAP.RabbitMQ/IConnectionChannelPool.Default.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ private static Func<Task<IConnection>> CreateConnection(RabbitMQOptions options)
109109
if (options.HostName.Contains(","))
110110
{
111111
options.ConnectionFactoryOptions?.Invoke(factory);
112-
113-
return () => factory.CreateConnectionAsync(AmqpTcpEndpoint.ParseMultiple(options.HostName));
112+
var endpoints = AmqpTcpEndpoint.ParseMultiple(options.HostName);
113+
foreach (var endpoint in endpoints)
114+
{
115+
endpoint.Ssl = factory.Ssl;
116+
}
117+
return () => factory.CreateConnectionAsync(endpoints);
114118
}
115119

116120
factory.HostName = options.HostName;
@@ -161,4 +165,4 @@ public virtual bool Return(IChannel channel)
161165

162166
return false;
163167
}
164-
}
168+
}

0 commit comments

Comments
 (0)