Camc.Abp.RemoteEventBus.RabbitMQ 4.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Camc.Abp.RemoteEventBus.RabbitMQ --version 4.4.0                
NuGet\Install-Package Camc.Abp.RemoteEventBus.RabbitMQ -Version 4.4.0                
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="Camc.Abp.RemoteEventBus.RabbitMQ" Version="4.4.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Camc.Abp.RemoteEventBus.RabbitMQ --version 4.4.0                
#r "nuget: Camc.Abp.RemoteEventBus.RabbitMQ, 4.4.0"                
#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.
// Install Camc.Abp.RemoteEventBus.RabbitMQ as a Cake Addin
#addin nuget:?package=Camc.Abp.RemoteEventBus.RabbitMQ&version=4.4.0

// Install Camc.Abp.RemoteEventBus.RabbitMQ as a Cake Tool
#tool nuget:?package=Camc.Abp.RemoteEventBus.RabbitMQ&version=4.4.0                

Abp.RemoteEventBus

起因

由于公司在使用 abp 做中台服务(还没有使用 abp vnext ),需要 远程消息;

本项目是在 参考了 wuyi6216/Abp.RemoteEventBusVolo.Abp.EventBus.RabbitMQ 改进的;

特别感谢

@Wuyi6216

使用

RemoteEventData

[Serializable]
public class TestRemoteEventData: RemoteEventData
{
	public string Name { get; set; }
}

[Serializable]
public class Test1RemoteEventData: RemoteEventData
{
	public string Name { get; set; }
}

RemoteEventHandler

public class TestRemoteEventHandler : IRemoteEventHandler<TestRemoteEventData>,
	IRemoteEventHandler<Test1RemoteEventData>, ITransientDependency
{
	public void HandleEvent(TestRemoteEventData eventData)
    {
    }

    public void HandleEvent(Test1RemoteEventData eventData)
    {
    }
}

Configuration

[DependsOn(typeof(CamcAbpRemoteEventBusRabbitMQModule))]
public class RabbitMQTestModule : AbpModule
{
	public override void Initialize()
    {
       IocManager.RegisterAssemblyByConvention(typeof(RabbitMQTestModule).GetAssembly());
    }
    
    public override void PostInitialize()
    {
        Configuration.Modules.RemoteEventBus().UseRabbitMQ().Configure(setting =>
        {
            setting.Url = "amqp://guest:guest@127.0.0.1:5672/";
            setting.ClientName = "ZTTest";
        });

        Configuration.Modules.RemoteEventBus().AutoSubscribe();
    }
}

Publish

// TODO:  依赖注入 _remoteEventBus(构造方法注入, 属性注入,IocManager解析)

_remoteEventBus.Publish(new TestRemoteEventData(){ Name = "TestMessage" });
_remoteEventBus.Publish(new Test1RemoteEventData(){ Name = "Test1Message" });

Subscribe

 public class TestRemoteEventHandler : IRemoteEventHandler<TestRemoteEventData>,
        IRemoteEventHandler<Test1RemoteEventData>, ITransientDependency
{
    public void HandleEvent(TestRemoteEventData eventData)
    {
    	// TODO: 处理类型为 TestRemoteEventData 消息
    }

    public void HandleEvent(Test1RemoteEventData eventData)
    {
    	// TODO: 处理类型为  Test1RemoteEventData 消息
	}
}

Demo

See Camc.Abp.RemoteEventBus.RabbitMQ.Test

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.4.2 732 1/2/2020
4.4.1 545 1/2/2020
4.4.0 518 12/28/2019