소스 검색

add borkeraddress to connectionpool.

master
Savorboard 6 년 전
부모
커밋
b7996be80b
4개의 변경된 파일16개의 추가작업 그리고 0개의 파일을 삭제
  1. +4
    -0
      src/DotNetCore.CAP.Kafka/ConnectionPool.cs
  2. +2
    -0
      src/DotNetCore.CAP.Kafka/IConnectionPool.cs
  3. +6
    -0
      src/DotNetCore.CAP.RabbitMQ/ConnectionChannelPool.cs
  4. +4
    -0
      src/DotNetCore.CAP.RabbitMQ/IConnectionChannelPool.cs

+ 4
- 0
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();


+ 2
- 0
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);


+ 6
- 0
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)


+ 4
- 0
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();


불러오는 중...
취소
저장