ServiceDisc 1.2.0
dotnet add package ServiceDisc --version 1.2.0
NuGet\Install-Package ServiceDisc -Version 1.2.0
<PackageReference Include="ServiceDisc" Version="1.2.0" />
paket add ServiceDisc --version 1.2.0
#r "nuget: ServiceDisc, 1.2.0"
// Install ServiceDisc as a Cake Addin #addin nuget:?package=ServiceDisc&version=1.2.0 // Install ServiceDisc as a Cake Tool #tool nuget:?package=ServiceDisc&version=1.2.0
ServiceDisc
ServiceDisc is a library for hosting and communicating between services. Service discovery is done through a common data collection. Each service will register in the collection when it's hosted to make it a simple process to reach it.
ServiceDisc requires common storage between clients and services. Currently Azure Storage is implemented, and in-memory storage for testing. Other storage can be implemented using the IServiceDiscConnection
interface which requires methods to register/unregister services and to send/receive queue messages.
There are two methods of communicating between services. Web API which will create a Web API controller to host the services, and a queue service which will listen to other services and reply through message queues. Queue service is default, this can be updated through the ServiceDiscClient.ServiceHostFactory
property (setting it to WebApiServiceHostFactory
will host the services with Web API instead).
Installing from NuGet
Install-Package ServiceDisc
Example
// Create a client, used for hosting and connecting to services.
// Pass an instance of AzureStorageServiceDiscConnection to store services in Azure,
// to enable having clients and services on different computers.
var serviceDisc = new ServiceDiscClient();
// Create an instance of a class to host as a service.
var helloService = new HelloService();
// Host the service and register it in the ServiceDisc.
// The service will now be known to other clients with the same IServiceDiscConnection
await serviceDisc.HostAsync<IHelloService>(helloService);
// Create a client for communicating with the IHelloService.
// This operation will search the common storage for services implementing IHelloService
// and create a proxy class to communicate with it.
var helloServiceClient = await serviceDisc.GetAsync<IHelloService>(serviceName);
// Send and receive a message from the service.
var world = helloServiceClient.Hello();
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.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. |
-
.NETStandard 2.0
- Castle.Core (>= 4.2.1)
- Microsoft.AspNetCore (>= 2.0.2)
- Microsoft.AspNetCore.Mvc (>= 2.0.3)
- WindowsAzure.Storage (>= 9.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.