EasilyNET.RabbitBus.AspNetCore 1.9.0-preview2

This is a prerelease version of EasilyNET.RabbitBus.AspNetCore.
There is a newer version of this package available.
See the version list below for details.
dotnet add package EasilyNET.RabbitBus.AspNetCore --version 1.9.0-preview2
                    
NuGet\Install-Package EasilyNET.RabbitBus.AspNetCore -Version 1.9.0-preview2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasilyNET.RabbitBus.AspNetCore" Version="1.9.0-preview2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasilyNET.RabbitBus.AspNetCore" Version="1.9.0-preview2" />
                    
Directory.Packages.props
<PackageReference Include="EasilyNET.RabbitBus.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EasilyNET.RabbitBus.AspNetCore --version 1.9.0-preview2
                    
#r "nuget: EasilyNET.RabbitBus.AspNetCore, 1.9.0-preview2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EasilyNET.RabbitBus.AspNetCore@1.9.0-preview2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EasilyNET.RabbitBus.AspNetCore&version=1.9.0-preview2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=EasilyNET.RabbitBus.AspNetCore&version=1.9.0-preview2&prerelease
                    
Install as a Cake Tool
EasilyNET.RabbitBus.AspNetCore
如何使用
  • 首先使用 Nuget 包管理工具添加依赖 EasilyNET.RabbitBus.AspNetCore
  • 等待下载完成和同意开源协议后,即可使用本库.
  • Step1.在 Program.cs 中配置消息总线
// 配置服务(亦可使用集群模式或者使用配置文件)
builder.Services.AddRabbitBus(c =>
{
    c.Host = "192.168.2.110";
    c.Port = 5672;
    c.UserName = "username";
    c.PassWord = "password";
    ...
});

// 注册服务
builder.Services.AddTransient<TestEventHandler>();
  • Step2.接下来配置事件和事件处理器
/// <summary>
/// 测试消息类型
/// </summary>
[Rabbit("hoyo.test", EExchange.Routing, "test", "orderqueue2")]
public class TestEvent : IntegrationEvent
{
    /// <summary>
    /// 消息
    /// </summary>
    public string Message { get; set; } = default!;
}

/// <summary>
/// 消息处理Handler
/// </summary>
public class TestEventHandler : IIntegrationEventHandler<TestEvent>
{
    private readonly ILogger<TestEventHandler> _logger;
    /// <summary>
    /// 构造函数
    /// </summary>
    /// <param name="logger"></param>
    public TestEventHandler(ILogger<TestEventHandler> logger)
    {
        _logger = logger;
    }
    /// <summary>
    /// 当消息到达的时候执行的Action
    /// </summary>
    /// <param name="event"></param>
    /// <returns></returns>
    public Task HandleAsync(TestEvent @event)
    {
        _logger.LogInformation("TestEvent_{event}-----{date}", @event.Message, DateTime.Now);
        return Task.CompletedTask;
    }
}
  • Step3.使用消息队列发送消息
private readonly IIntegrationEventBus _ibus;
// 控制器构造函数伪代码
construct(IIntegrationEventBus ibus){
   _ibus = ibus;
}
/// <summary>
/// 创建一个延时消息,同时发送一个普通消息做对比
/// </summary>
[HttpPost("TTLTest")]
public void TTLTest()
{
    var rand = new Random();
    var ttl = rand.Next(1000, 10000);
    var ttlobj = new DelayedMessageEvent() { Message = $"延迟{ttl}毫秒,当前时间{DateTime.Now:yyyy-MM-dd HH:mm:ss}" };
    // 延时队列需要服务端安装延时队列插件.
    _ibus.Publish(ttlobj, (uint)ttl);
    _ibus.Publish(ttlobj);
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.25.820.100 93 8/20/2025
4.25.814.175 118 8/14/2025
4.25.731.155 98 7/31/2025
4.25.724.1 490 7/23/2025
4.25.720.80 191 7/20/2025
4.25.716.42 118 7/15/2025
4.25.617.153 136 6/17/2025
4.25.616.190 128 6/16/2025
4.25.616.182 123 6/16/2025
4.25.613.111 268 6/13/2025
4.25.609.190 223 6/9/2025
4.25.609.181 213 6/9/2025
4.25.609.163 214 6/9/2025
4.25.609.140 199 6/9/2025
4.25.605.171 132 6/5/2025
4.25.605.104 137 6/5/2025
4.25.602.41 137 6/1/2025
4.25.526.140 135 5/26/2025
4.25.513.101 227 5/13/2025
4.25.506.150 138 5/6/2025
4.25.429.162 144 4/29/2025
4.25.429.103 168 4/29/2025
4.25.411.142 135 4/11/2025
4.25.409.92 151 4/9/2025
4.25.403.133 154 4/3/2025
4.25.319.113 166 3/19/2025
4.25.312.103 165 3/12/2025
4.25.227.135 102 2/27/2025
4.25.212.95 248 2/12/2025
4.25.211.140 105 2/11/2025
4.25.124.223 87 1/24/2025
3.24.1206.100 97 12/6/2024
3.24.1205.171 99 12/5/2024
3.24.1202.150 97 12/2/2024
3.24.1126.231 101 11/26/2024
3.24.1126.172 94 11/26/2024
3.24.1126.114 97 11/26/2024
3.24.1126.104 95 11/26/2024
3.24.1125.181 88 11/25/2024
3.24.1125.104 98 11/25/2024
3.24.1121.183 89 11/21/2024
3.24.1120.183 91 11/20/2024
3.24.1119.31 98 11/18/2024
3.24.1115.143 81 11/15/2024
3.24.1113.100 98 11/13/2024
3.24.1112.125 586 11/12/2024
3.24.1107.140 92 11/7/2024
3.24.1107.54 89 11/7/2024
3.24.1107.34 92 11/7/2024
3.24.1105.111 94 11/5/2024
3.24.1103.31 99 11/2/2024
3.24.1103 94 11/2/2024
3.24.1031.135 92 10/31/2024
3.24.1031.112 90 10/31/2024
3.24.1031.104 92 10/31/2024
3.24.1029.142 93 10/29/2024
3.24.1025.30 190 10/24/2024
3.24.1022.142 83 10/22/2024
3.24.1018.204 145 10/18/2024
3.24.1018.175 139 10/18/2024
3.24.1018.166 140 10/18/2024
3.24.1018.93 142 10/18/2024
3.24.1017.42 92 10/16/2024
3.24.1016.161 93 10/16/2024
3.24.1015.231 92 10/15/2024
3.24.1015.14 98 10/14/2024
3.24.1012.114 87 10/12/2024
3.24.1009.115 97 10/9/2024
3.24.1008.160 96 10/8/2024
3.24.1008.133 88 10/8/2024
3.24.1007.185 96 10/7/2024
3.24.1003.33 99 10/2/2024
3.24.1002.162 98 10/2/2024
3.24.929.143 94 9/29/2024
3.24.929.141 93 9/29/2024
3.24.929.131 95 9/29/2024
3.24.929.122 96 9/29/2024
3.24.926.184 100 9/26/2024
3.24.926.182 101 9/26/2024
3.24.926.175 103 9/26/2024
3.24.924.160 97 9/24/2024
3.24.924.133 104 9/24/2024
3.24.924.124 95 9/24/2024
3.24.924.10 108 9/23/2024
3.24.924.1 90 9/23/2024
3.24.923.234 97 9/23/2024
3.24.923.232 95 9/23/2024
3.24.923.155 94 9/23/2024
3.24.919.92 107 9/19/2024
3.24.914.125 101 9/14/2024
3.24.914.115 102 9/14/2024
3.24.914.111 106 9/14/2024
3.24.911.95 98 9/11/2024
3.24.908.215 92 9/8/2024
3.24.904.200 98 9/4/2024
3.24.828.163 103 8/28/2024
3.24.820.173 102 8/20/2024
3.24.814.92 112 8/14/2024
3.24.812.115 108 8/12/2024
3.24.802.100 85 8/2/2024
3.24.801.162 89 8/1/2024
3.24.801.160 92 8/1/2024
3.24.801.155 94 8/1/2024
3.24.730.164 85 7/30/2024
3.24.730.91 80 7/30/2024
3.24.724.91 87 7/24/2024
3.24.718.105 111 7/18/2024
3.24.716.95 97 7/16/2024
3.24.712.94 98 7/12/2024
3.24.710.14 93 7/9/2024
3.24.709.105 97 7/9/2024
3.24.704.94 101 7/4/2024
3.24.701.90 93 7/1/2024
3.24.628.114 104 6/28/2024
3.24.627.145 98 6/27/2024
3.24.620.160 105 6/20/2024
3.24.613.115 96 6/13/2024
3.24.612.95 105 6/12/2024
3.24.528.90 96 5/28/2024
3.24.522.84 113 5/22/2024
3.24.512.213 96 5/12/2024
3.24.508.112 112 5/8/2024
2.2024.428.71 105 4/28/2024
2.2024.427.1128 105 4/27/2024
2.2.72 122 4/14/2024
2.2.71 99 4/12/2024
2.2.8 103 4/26/2024
2.2.6 96 4/10/2024
2.2.5 122 3/26/2024
2.2.4 112 3/25/2024
2.2.3 108 3/24/2024
2.2.2 117 3/21/2024
2.2.1 117 3/20/2024
2.2.0 118 3/13/2024
2.1.9 112 2/21/2024
2.1.8 114 2/18/2024
2.1.7 119 2/16/2024
2.1.6 129 2/14/2024
2.1.5 105 2/14/2024
2.1.4 129 2/9/2024
2.1.3 112 2/8/2024
2.1.2 136 2/5/2024
2.1.1.2 185 12/26/2023
2.1.1.1 122 12/26/2023
2.1.1 122 12/25/2023
2.1.0 139 12/17/2023
2.0.11 155 12/6/2023
2.0.1 153 11/15/2023
2.0.0 112 11/14/2023
1.9.1 128 11/1/2023
1.9.0 127 10/19/2023
1.9.0-preview2 247 10/12/2023
1.9.0-preview1 102 10/12/2023
1.8.9 159 10/11/2023
1.8.8 151 10/11/2023
1.8.7-rc2 111 9/21/2023
1.8.7-rc1 107 9/12/2023
1.8.6 157 8/31/2023
1.8.5 584 8/25/2023
1.8.4 145 8/24/2023
1.8.3 143 8/23/2023
1.8.2 185 8/22/2023
1.8.1 146 8/18/2023
1.8.0 150 8/15/2023
1.7.9 173 8/11/2023
1.7.8 146 8/11/2023
1.7.7 159 8/10/2023
1.7.6 156 8/9/2023
1.7.5 181 8/9/2023
1.7.4 194 8/3/2023
1.7.3 165 8/1/2023
1.7.2 161 7/31/2023
1.7.1 154 7/27/2023
1.7.0 169 7/25/2023
1.6.9 165 7/25/2023
1.6.8 152 7/24/2023
1.6.7 170 7/20/2023
1.6.6 166 7/19/2023
1.6.5 135 7/19/2023
1.6.4 153 7/17/2023
1.6.3 151 7/17/2023
1.6.2 171 7/12/2023
1.6.1 170 6/30/2023
1.6.0 153 6/30/2023