With the continuous development of the website system, the complexity of the architecture will change from MVC->SOA->microservices, from simple to complex, from centralized to distributed. The introduction of the service framework is SOA->microservice process The problem that must be solved. In the face of the increase in services, the deployment of service distribution, the mutual call between services and services, have to use the service framework to solve. Based on NET Core 2.0 Standard 2 development, DotEasy.RPC supports transparent calls from the client to the server, just as simple as an implementation call to an interface.
- Automate assembly and construction of related component types using Microsoft.Extensions.Dependency Injection.
- Serialization of byte streams using protobuf-net
- Generated by Roslyn's runtime client proxy
- Communication pipeline and host built on DotNetty
http://www.cnblogs.com/SteveLee/
for the server and add the code in you Web API Core, implement microservice middleware injection.
app.UseConsulServerExtensions(Configuration,
collection =>
{
collection.AddSingleton<IProxyService, ProxyImpl>();
},
typeof(AuthorizationServerProvider)
);
and in the console application, you can use interface proxy the implement client code.
using (var proxy = ClientProxy.Generate<IProxyService>(new Uri("http://127.0.0.1:8500")))
{
Console.WriteLine($@"{proxy.Sync(1)}");
Console.WriteLine($@"{proxy.Async(1).Result}");
Console.WriteLine($@"{proxy.GetDictionaryAsync().Result["key"]}");
}
- Greatly simplify the writing of client-side calling code, read to 'How to use'.
- Support the client to access the service node in the form of token.
- Class instance auto disponse.
- Added precompiled synchronous and asynchronous remote invocation methods, unforcing the use of Task as asynchronous calls and precompiled builds.
- Added Consul registration and callback to implement the configuration of the Consul registry.
- Added Entry lazy entry class library package to implement Asp.net middleware extension and host based on Console application.