EasilyNET.RabbitBus.AspNetCore 1.9.0-preview1

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-preview1
                    
NuGet\Install-Package EasilyNET.RabbitBus.AspNetCore -Version 1.9.0-preview1
                    
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-preview1" />
                    
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-preview1" />
                    
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-preview1
                    
#r "nuget: EasilyNET.RabbitBus.AspNetCore, 1.9.0-preview1"
                    
#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.
#addin nuget:?package=EasilyNET.RabbitBus.AspNetCore&version=1.9.0-preview1&prerelease
                    
Install EasilyNET.RabbitBus.AspNetCore as a Cake Addin
#tool nuget:?package=EasilyNET.RabbitBus.AspNetCore&version=1.9.0-preview1&prerelease
                    
Install EasilyNET.RabbitBus.AspNetCore 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.617.153 107 6 days ago
4.25.616.190 105 7 days ago
4.25.616.182 105 7 days ago
4.25.613.111 249 10 days ago
4.25.609.190 205 14 days ago
4.25.609.181 196 14 days ago
4.25.609.163 198 14 days ago
4.25.609.140 183 14 days ago
4.25.605.171 115 18 days ago
4.25.605.104 120 18 days ago
4.25.602.41 119 21 days ago
4.25.526.140 122 a month ago
4.25.513.101 211 a month ago
4.25.506.150 124 2 months ago
4.25.429.162 129 2 months ago
4.25.429.103 153 2 months ago
4.25.411.142 117 2 months ago
4.25.409.92 137 2 months ago
4.25.403.133 138 3 months ago
4.25.319.113 148 3 months ago
4.25.312.103 149 3 months ago
4.25.227.135 84 4 months ago
4.25.212.95 233 4 months ago
4.25.211.140 88 4 months ago
4.25.124.223 73 5 months ago
3.24.1206.100 81 7 months ago
3.24.1205.171 86 7 months ago
3.24.1202.150 81 7 months ago
3.24.1126.231 85 7 months ago
3.24.1126.172 80 7 months ago
3.24.1126.114 81 7 months ago
3.24.1126.104 78 7 months ago
3.24.1125.181 72 7 months ago
3.24.1125.104 81 7 months ago
3.24.1121.183 75 7 months ago
3.24.1120.183 77 7 months ago
3.24.1119.31 79 7 months ago
3.24.1115.143 65 7 months ago
3.24.1113.100 81 7 months ago
3.24.1112.125 568 7 months ago
3.24.1107.140 75 8 months ago
3.24.1107.54 75 8 months ago
3.24.1107.34 76 8 months ago
3.24.1105.111 79 8 months ago
3.24.1103.31 85 8 months ago
3.24.1103 80 8 months ago
3.24.1031.135 75 8 months ago
3.24.1031.112 75 8 months ago
3.24.1031.104 77 8 months ago
3.24.1029.142 79 8 months ago
3.24.1025.30 173 8 months ago
3.24.1022.142 68 8 months ago
3.24.1018.204 131 8 months ago
3.24.1018.175 123 8 months ago
3.24.1018.166 125 8 months ago
3.24.1018.93 127 8 months ago
3.24.1017.42 77 8 months ago
3.24.1016.161 79 8 months ago
3.24.1015.231 79 8 months ago
3.24.1015.14 81 8 months ago
3.24.1012.114 74 8 months ago
3.24.1009.115 82 8 months ago
3.24.1008.160 81 8 months ago
3.24.1008.133 74 8 months ago
3.24.1007.185 81 9 months ago
3.24.1003.33 84 9 months ago
3.24.1002.162 83 9 months ago
3.24.929.143 82 9 months ago
3.24.929.141 79 9 months ago
3.24.929.131 78 9 months ago
3.24.929.122 81 9 months ago
3.24.926.184 83 9 months ago
3.24.926.182 83 9 months ago
3.24.926.175 85 9 months ago
3.24.924.160 81 9 months ago
3.24.924.133 89 9 months ago
3.24.924.124 80 9 months ago
3.24.924.10 89 9 months ago
3.24.924.1 75 9 months ago
3.24.923.234 78 9 months ago
3.24.923.232 80 9 months ago
3.24.923.155 80 9 months ago
3.24.919.92 92 9 months ago
3.24.914.125 88 9 months ago
3.24.914.115 81 9 months ago
3.24.914.111 83 9 months ago
3.24.911.95 81 9 months ago
3.24.908.215 75 9 months ago
3.24.904.200 81 10 months ago
3.24.828.163 89 10 months ago
3.24.820.173 89 8/20/2024
3.24.814.92 98 8/14/2024
3.24.812.115 93 8/12/2024
3.24.802.100 71 8/2/2024
3.24.801.162 76 8/1/2024
3.24.801.160 81 8/1/2024
3.24.801.155 79 8/1/2024
3.24.730.164 70 7/30/2024
3.24.730.91 64 7/30/2024
3.24.724.91 74 7/24/2024
3.24.718.105 96 7/18/2024
3.24.716.95 84 7/16/2024
3.24.712.94 84 7/12/2024
3.24.710.14 79 7/9/2024
3.24.709.105 86 7/9/2024
3.24.704.94 85 7/4/2024
3.24.701.90 81 7/1/2024
3.24.628.114 89 6/28/2024
3.24.627.145 83 6/27/2024
3.24.620.160 89 6/20/2024
3.24.613.115 83 6/13/2024
3.24.612.95 88 6/12/2024
3.24.528.90 83 5/28/2024
3.24.522.84 98 5/22/2024
3.24.512.213 82 5/12/2024
3.24.508.112 98 5/8/2024
2.2024.428.71 92 4/28/2024
2.2024.427.1128 92 4/27/2024
2.2.72 104 4/14/2024
2.2.71 85 4/12/2024
2.2.8 89 4/26/2024
2.2.6 83 4/10/2024
2.2.5 108 3/26/2024
2.2.4 101 3/25/2024
2.2.3 92 3/24/2024
2.2.2 99 3/21/2024
2.2.1 102 3/20/2024
2.2.0 105 3/13/2024
2.1.9 99 2/21/2024
2.1.8 100 2/18/2024
2.1.7 103 2/16/2024
2.1.6 115 2/14/2024
2.1.5 93 2/14/2024
2.1.4 117 2/9/2024
2.1.3 99 2/8/2024
2.1.2 125 2/5/2024
2.1.1.2 173 12/26/2023
2.1.1.1 109 12/26/2023
2.1.1 111 12/25/2023
2.1.0 127 12/17/2023
2.0.11 147 12/6/2023
2.0.1 144 11/15/2023
2.0.0 101 11/14/2023
1.9.1 116 11/1/2023
1.9.0 112 10/19/2023
1.9.0-preview2 228 10/12/2023
1.9.0-preview1 86 10/12/2023
1.8.9 143 10/11/2023
1.8.8 131 10/11/2023
1.8.7-rc2 92 9/21/2023
1.8.7-rc1 89 9/12/2023
1.8.6 133 8/31/2023
1.8.5 558 8/25/2023
1.8.4 123 8/24/2023
1.8.3 120 8/23/2023
1.8.2 162 8/22/2023
1.8.1 124 8/18/2023
1.8.0 127 8/15/2023
1.7.9 149 8/11/2023
1.7.8 124 8/11/2023
1.7.7 136 8/10/2023
1.7.6 130 8/9/2023
1.7.5 156 8/9/2023
1.7.4 171 8/3/2023
1.7.3 138 8/1/2023
1.7.2 136 7/31/2023
1.7.1 130 7/27/2023
1.7.0 138 7/25/2023
1.6.9 139 7/25/2023
1.6.8 126 7/24/2023
1.6.7 143 7/20/2023
1.6.6 140 7/19/2023
1.6.5 108 7/19/2023
1.6.4 128 7/17/2023
1.6.3 125 7/17/2023
1.6.2 145 7/12/2023
1.6.1 144 6/30/2023
1.6.0 126 6/30/2023