Commit 9112fa72 authored by Savorboard's avatar Savorboard

add borkeraddress to connectionpool.

parent e8846e81
...@@ -21,8 +21,12 @@ namespace DotNetCore.CAP.Kafka ...@@ -21,8 +21,12 @@ namespace DotNetCore.CAP.Kafka
{ {
_maxSize = options.ConnectionPoolSize; _maxSize = options.ConnectionPoolSize;
_activator = CreateActivator(options); _activator = CreateActivator(options);
ServersAddress = options.Servers;
} }
public string ServersAddress { get; }
Producer IConnectionPool.Rent() Producer IConnectionPool.Rent()
{ {
return Rent(); return Rent();
......
...@@ -7,6 +7,8 @@ namespace DotNetCore.CAP.Kafka ...@@ -7,6 +7,8 @@ namespace DotNetCore.CAP.Kafka
{ {
public interface IConnectionPool public interface IConnectionPool
{ {
string ServersAddress { get; }
Producer Rent(); Producer Rent();
bool Return(Producer context); bool Return(Producer context);
......
...@@ -28,6 +28,8 @@ namespace DotNetCore.CAP.RabbitMQ ...@@ -28,6 +28,8 @@ namespace DotNetCore.CAP.RabbitMQ
_maxSize = DefaultPoolSize; _maxSize = DefaultPoolSize;
_connectionActivator = CreateConnection(options); _connectionActivator = CreateConnection(options);
HostAddress = options.HostName + ":" + options.Port;
Exchange = options.ExchangeName;
} }
IModel IConnectionChannelPool.Rent() IModel IConnectionChannelPool.Rent()
...@@ -40,6 +42,10 @@ namespace DotNetCore.CAP.RabbitMQ ...@@ -40,6 +42,10 @@ namespace DotNetCore.CAP.RabbitMQ
return Return(connection); return Return(connection);
} }
public string HostAddress { get; }
public string Exchange { get; }
public IConnection GetConnection() public IConnection GetConnection()
{ {
if (_connection != null && _connection.IsOpen) if (_connection != null && _connection.IsOpen)
......
...@@ -7,6 +7,10 @@ namespace DotNetCore.CAP.RabbitMQ ...@@ -7,6 +7,10 @@ namespace DotNetCore.CAP.RabbitMQ
{ {
public interface IConnectionChannelPool public interface IConnectionChannelPool
{ {
string HostAddress { get; }
string Exchange { get; }
IConnection GetConnection(); IConnection GetConnection();
IModel Rent(); IModel Rent();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment