You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using RabbitMQ.Client;
|
|
using System;
|
|
|
|
namespace EntrustSettle.EventBus
|
|
{
|
|
/// <summary>
|
|
/// RabbitMQ持久连接
|
|
/// 接口
|
|
/// </summary>
|
|
public interface IRabbitMQPersistentConnection
|
|
: IDisposable
|
|
{
|
|
/// <summary>
|
|
/// 是否已经连接
|
|
/// </summary>
|
|
bool IsConnected { get; }
|
|
|
|
/// <summary>
|
|
/// 尝试重连
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
bool TryConnect();
|
|
|
|
/// <summary>
|
|
/// 创建Model
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
IModel CreateModel();
|
|
|
|
/// <summary>
|
|
/// 发布消息
|
|
/// </summary>
|
|
/// <param name="message"></param>
|
|
/// <param name="exchangeName"></param>
|
|
/// <param name="routingKey"></param>
|
|
void PublishMessage(string message, string exchangeName, string routingKey);
|
|
|
|
/// <summary>
|
|
/// 订阅消息
|
|
/// </summary>
|
|
/// <param name="queueName"></param>
|
|
void StartConsuming(string queueName);
|
|
}
|
|
}
|