Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fanliang11/surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
https://github.com/fanliang11/surging
apigateway apollo consul dns-server grpc json-serialization kafka kestrel log4net memorycache messagepack microservices nlog protobuffer rabbitmq redis skywalking surging swagger zookeeper
Last synced: 27 days ago
JSON representation
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
- Host: GitHub
- URL: https://github.com/fanliang11/surging
- Owner: fanliang11
- License: mit
- Created: 2017-06-16T13:17:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-04T15:27:35.000Z (6 months ago)
- Last Synced: 2024-05-29T16:53:41.474Z (5 months ago)
- Topics: apigateway, apollo, consul, dns-server, grpc, json-serialization, kafka, kestrel, log4net, memorycache, messagepack, microservices, nlog, protobuffer, rabbitmq, redis, skywalking, surging, swagger, zookeeper
- Language: C#
- Homepage:
- Size: 27.2 MB
- Stars: 3,234
- Watchers: 305
- Forks: 924
- Open Issues: 252
-
Metadata Files:
- Readme: README.EN.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# surging [中文](https://github.com/dotnetcore/surging/blob/master/README.md)
[![Member project of .NET Core Community](https://img.shields.io/badge/member%20project%20of-NCC-9e20c9.svg)](https://github.com/dotnetcore)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://mit-license.org/)
# surging is a distributed micro service framework that provides high-performance RPC remote service calls, using Zookeeper, Consul as the registration center for surging services, integrating hash, random, polling as a load balancing algorithm, RPC integration using the netty framework, Using asynchronous transmission.### Architecture:
### Start configuration:
```c#
var host = new ServiceHostBuilder()
.RegisterServices(builder =>
{
builder.AddMicroService(option =>
{
option.AddServiceRuntime();//
// option.UseZooKeeperManager(new ConfigInfo("127.0.0.1:2181")); //Using a Zookeeper management
option.UseConsulManager(new ConfigInfo("127.0.0.1:8500"));//Use the Consul management
option.UseDotNettyTransport();//Use Netty transmission
option.UseRabbitMQTransport();//Use the rabbitmq transmission
option.AddRabbitMQAdapt();//Based on the consumption of the rabbitmq service adaptation
builder.Register(p => new CPlatformContainer(ServiceLocator.Current));//Initializes the injection container
});
})
.SubscribeAt() //News Feeds
.UseServer("127.0.0.1", 98)
//.UseServer("127.0.0.1", 98,“true”) //Automatically generate Token
//.UseServer("127.0.0.1", 98,“123456789”) //Fixed password Token
.UseLog4net("Configs/log4net.config") //Use log4net to generate the log
.UseLog4net() //Use log4net to generate the log
.UseStartup()
.Build();
using (host.Run())
{
Console.WriteLine($"The server startup success,{DateTime.Now}。");
}
```
Subscription function:
```c#
ServiceLocator.GetService< ISubscriptionAdapt >().SubscribeAt();
```
Increase service fault-tolerant, fault-tolerant forcibly demote demotion and service* Increase the fault tolerance strategy Injection, the local module injection:
```c#
[Command(Strategy= StrategyType.Injection ,Injection = @"return null;")]
```
```C#
[Command(Strategy= StrategyType.Injection ,Injection = @"return
Task.FromResult(new Surging.IModuleServices.Common.Models.UserModel
{
Name=""fanly"",
Age=18
});",InjectionNamespaces =new string[] { "Surging.IModuleServices.Common"})]
```* Increase Injection fault-tolerant strategy, local Injection module:
```C#
[Command(Strategy= StrategyType.Injection ,Injection = @"return true;")]
```
Increase the cache relegation, how to use?
Add the following features in the business interface methods```C#
[Command(Strategy= StrategyType.Failover,FailoverCluster =3,RequestCacheEnabled =true)] //RequestCacheEnabled =true Is to enable the cache
```
How to intercept access to cache?
Add the following features in the business interface methods
```C#
[InterceptMethod(CachingMethod.Get, Key = "GetUser_id_{0}", Mode = CacheTargetType.Redis, Time = 480)]
```
How to intercept the delete cache?
Add the following features in the business interface methods
```C#
[InterceptMethod(CachingMethod.Remove, "GetUser_id_{0}", "GetUserName_name_{0}", Mode = CacheTargetType.Redis)]
```
How to add the cache KEY
On the business model attribute to add, the following features, can support multiple
```C#
[CacheKey(1)]
```
Configuring Interceptors
```C#
.AddClientIntercepted(typeof(CacheProviderInterceptor))
```IDE:Visual Studio 2017 15.3 Preview ,vscode
The framework:.NET core 2.0
如有任何问题可以加入QQ群:542283494 Gitter:not room
[Blog]:https://www.cnblogs.com/fanliang11