Redi.APICommunication
1.0.1
See the version list below for details.
dotnet add package Redi.APICommunication --version 1.0.1
NuGet\Install-Package Redi.APICommunication -Version 1.0.1
<PackageReference Include="Redi.APICommunication" Version="1.0.1" />
paket add Redi.APICommunication --version 1.0.1
#r "nuget: Redi.APICommunication, 1.0.1"
// Install Redi.APICommunication as a Cake Addin
#addin nuget:?package=Redi.APICommunication&version=1.0.1
// Install Redi.APICommunication as a Cake Tool
#tool nuget:?package=Redi.APICommunication&version=1.0.1
Documentation of Redi.APICommunication This package helps for API communication in multi-service architecture. It involves 5 levels for configuration:
Level 1:
Add connection to configuration/appsettings file
"rabbit": { "UserName": "guest", "Password": "guest", "HostName": "localhost", "VHost": "/", "Port": 4000 }
Level 2:
public void ConfigureServices(IServiceCollection services) { // Configure Rabbit settings. services.AddRabbit(Configuration);
}
Level 3:
The thought process of RabbitMQ is pubsub. The subscriber class will inherit from RabbitSubcriberBase
public class RouteRabbitScriber : RabbitSubcriberBase { public RouteRabbitScriber(IRabbitManager manager) : base(manager) { manager.Subscribe<RouteDTO>(“Device_Route”, “Route_Updated”, (model) ⇒ { // perform your update there using the model });
}
}
Level 4:
Register the subscriber class with rabbit engine.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.RegisterRabbitSubscriber<RouteRabbitScriber, IDeviceCommandRepository>();
}
Level 5:
The publisher need to have the object of the rabbitManager
public RoutesController(IRabbitManager rabbitmanager)
{
this.rabbitmanager = rabbitmanager;
}
// PUT: api/Routes/5
[HttpPut("{id}")]
public async Task<int> Put(Guid id, [FromBody] RouteDTO value)
{
// Do your updte here
rabbitmanager.Publish<RouteDTO>(value, “Device_Route”, “Device_Route”, “Route_Updated”, null);
//return your object; }
Product | Versions 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.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.2
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.0)
- Microsoft.Extensions.ObjectPool (>= 3.1.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 3.1.0)
- Newtonsoft.Json (>= 12.0.3)
- RabbitMQ.Client (>= 5.1.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.