diff --git a/src/DotNetCore.CAP.Kafka/ConnectionPool.cs b/src/DotNetCore.CAP.Kafka/ConnectionPool.cs index 6879942..1993661 100644 --- a/src/DotNetCore.CAP.Kafka/ConnectionPool.cs +++ b/src/DotNetCore.CAP.Kafka/ConnectionPool.cs @@ -21,8 +21,12 @@ namespace DotNetCore.CAP.Kafka { _maxSize = options.ConnectionPoolSize; _activator = CreateActivator(options); + + ServersAddress = options.Servers; } + public string ServersAddress { get; } + Producer IConnectionPool.Rent() { return Rent(); diff --git a/src/DotNetCore.CAP.Kafka/IConnectionPool.cs b/src/DotNetCore.CAP.Kafka/IConnectionPool.cs index 7fb01a5..ed86d7f 100644 --- a/src/DotNetCore.CAP.Kafka/IConnectionPool.cs +++ b/src/DotNetCore.CAP.Kafka/IConnectionPool.cs @@ -7,6 +7,8 @@ namespace DotNetCore.CAP.Kafka { public interface IConnectionPool { + string ServersAddress { get; } + Producer Rent(); bool Return(Producer context); diff --git a/src/DotNetCore.CAP.RabbitMQ/ConnectionChannelPool.cs b/src/DotNetCore.CAP.RabbitMQ/ConnectionChannelPool.cs index 4e028d1..e650518 100644 --- a/src/DotNetCore.CAP.RabbitMQ/ConnectionChannelPool.cs +++ b/src/DotNetCore.CAP.RabbitMQ/ConnectionChannelPool.cs @@ -28,6 +28,8 @@ namespace DotNetCore.CAP.RabbitMQ _maxSize = DefaultPoolSize; _connectionActivator = CreateConnection(options); + HostAddress = options.HostName + ":" + options.Port; + Exchange = options.ExchangeName; } IModel IConnectionChannelPool.Rent() @@ -40,6 +42,10 @@ namespace DotNetCore.CAP.RabbitMQ return Return(connection); } + public string HostAddress { get; } + + public string Exchange { get; } + public IConnection GetConnection() { if (_connection != null && _connection.IsOpen) diff --git a/src/DotNetCore.CAP.RabbitMQ/IConnectionChannelPool.cs b/src/DotNetCore.CAP.RabbitMQ/IConnectionChannelPool.cs index d7a6b08..5361529 100644 --- a/src/DotNetCore.CAP.RabbitMQ/IConnectionChannelPool.cs +++ b/src/DotNetCore.CAP.RabbitMQ/IConnectionChannelPool.cs @@ -7,6 +7,10 @@ namespace DotNetCore.CAP.RabbitMQ { public interface IConnectionChannelPool { + string HostAddress { get; } + + string Exchange { get; } + IConnection GetConnection(); IModel Rent();