{"id":29012670,"url":"https://github.com/microsurging/surging","last_synced_at":"2025-06-25T19:02:15.254Z","repository":{"id":40516056,"uuid":"94545558","full_name":"microsurging/surging","owner":"microsurging","description":"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","archived":false,"fork":false,"pushed_at":"2025-06-25T09:48:19.000Z","size":30281,"stargazers_count":3250,"open_issues_count":252,"forks_count":919,"subscribers_count":303,"default_branch":"master","last_synced_at":"2025-06-25T10:43:27.428Z","etag":null,"topics":["apigateway","apollo","consul","dns-server","grpc","json-serialization","kafka","kestrel","log4net","memorycache","messagepack","microservices","nlog","protobuffer","rabbitmq","redis","skywalking","surging","swagger","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsurging.png","metadata":{"files":{"readme":"README.EN.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-06-16T13:17:30.000Z","updated_at":"2025-06-25T09:48:23.000Z","dependencies_parsed_at":"2024-05-20T11:02:00.050Z","dependency_job_id":"2dea516c-0439-464c-964e-41dc58df6e18","html_url":"https://github.com/microsurging/surging","commit_stats":{"total_commits":832,"total_committers":22,"mean_commits":37.81818181818182,"dds":0.06850961538461542,"last_synced_commit":"660e73d8a74aee2742ee8ed7eb6dc7accd83f777"},"previous_names":["dotnetcore/surging","microsurging/surging"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/microsurging/surging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsurging%2Fsurging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsurging%2Fsurging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsurging%2Fsurging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsurging%2Fsurging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsurging","download_url":"https://codeload.github.com/microsurging/surging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsurging%2Fsurging/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261937021,"owners_count":23232842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apigateway","apollo","consul","dns-server","grpc","json-serialization","kafka","kestrel","log4net","memorycache","messagepack","microservices","nlog","protobuffer","rabbitmq","redis","skywalking","surging","swagger","zookeeper"],"created_at":"2025-06-25T19:01:33.450Z","updated_at":"2025-06-25T19:02:15.201Z","avatar_url":"https://github.com/microsurging.png","language":"C#","readme":"# surging 　　　　　　　　　　　　　　　　　　　　[中文](https://github.com/dotnetcore/surging/blob/master/README.md)\n[![Member project of .NET Core Community](https://img.shields.io/badge/member%20project%20of-NCC-9e20c9.svg)](https://github.com/dotnetcore)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://mit-license.org/)\n# 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.\n\u003cbr /\u003e\n\n### Architecture：\n\n\u003cimg src=\"https://github.com/dotnetcore/surging/blob/master/docs/Architecture.png\" alt=\"架构图\" /\u003e\n\n### Start configuration：\n\n \u003cbr/\u003e\n \n ```c#\nvar host = new ServiceHostBuilder()\n                .RegisterServices(builder =\u003e\n                {\n                    builder.AddMicroService(option =\u003e\n                    {\n                        option.AddServiceRuntime();//\n                        // option.UseZooKeeperManager(new ConfigInfo(\"127.0.0.1:2181\")); //Using a Zookeeper management\n                        option.UseConsulManager(new ConfigInfo(\"127.0.0.1:8500\"));//Use the Consul management\n                        option.UseDotNettyTransport();//Use Netty transmission\n                        option.UseRabbitMQTransport();//Use the rabbitmq transmission\n                        option.AddRabbitMQAdapt();//Based on the consumption of the rabbitmq service adaptation\n                        builder.Register(p =\u003e new CPlatformContainer(ServiceLocator.Current));//Initializes the injection container\n                    });\n                })\n                .SubscribeAt()     //News Feeds\n                .UseServer(\"127.0.0.1\", 98)\n              //.UseServer(\"127.0.0.1\", 98，“true”) //Automatically generate Token\n              //.UseServer(\"127.0.0.1\", 98，“123456789”) //Fixed password Token\n                .UseLog4net(\"Configs/log4net.config\") //Use log4net to generate the log\n                .UseLog4net()  //Use log4net to generate the log\n                .UseStartup\u003cStartup\u003e()\n                .Build();\n                \n            using (host.Run())\n            {\n                Console.WriteLine($\"The server startup success，{DateTime.Now}。\");\n            }\n ```    \n                \n\u003cbr/\u003e\n\nSubscription function：\n\u003cbr/\u003e\n\n```c#\n ServiceLocator.GetService\u003c ISubscriptionAdapt \u003e().SubscribeAt();\n ```    \n \n \u003cbr/\u003e\nIncrease service fault-tolerant, fault-tolerant forcibly demote demotion and service\n\n\n* Increase the fault tolerance strategy Injection, the local module injection：\n\n\u003cbr/\u003e\n\n```c#\n[Command(Strategy= StrategyType.Injection ,Injection = @\"return null;\")]\n```    \n\n \u003cbr/\u003e\n \n```C#  \n[Command(Strategy= StrategyType.Injection ,Injection = @\"return \nTask.FromResult(new Surging.IModuleServices.Common.Models.UserModel\n         {\n            Name=\"\"fanly\"\",\n            Age=18\n         });\",InjectionNamespaces =new string[] { \"Surging.IModuleServices.Common\"})] \n```\n\n\n* Increase Injection fault-tolerant strategy, local Injection module：   \n\n\u003cbr/\u003e\n\n```C#  \n[Command(Strategy= StrategyType.Injection ,Injection = @\"return true;\")] \n```\n\n\u003cbr/\u003e\n\nIncrease the cache relegation, how to use?\n\u003cbr/\u003e\nAdd the following features in the business interface methods\n\u003cbr/\u003e\n\n```C#  \n   [Command(Strategy= StrategyType.Failover,FailoverCluster =3,RequestCacheEnabled =true)]  //RequestCacheEnabled =true Is to enable the cache\n```\n\n\u003cbr/\u003e\nHow to intercept access to cache？\n \u003cbr/\u003e\nAdd the following features in the business interface methods\n \u003cbr/\u003e\n \n```C#  \n [InterceptMethod(CachingMethod.Get, Key = \"GetUser_id_{0}\", Mode = CacheTargetType.Redis, Time = 480)]\n```\n    \n\u003cbr/\u003e\nHow to intercept the delete cache？\n \u003cbr/\u003e\nAdd the following features in the business interface methods\n \u003cbr/\u003e\n \n```C#  \n  [InterceptMethod(CachingMethod.Remove, \"GetUser_id_{0}\", \"GetUserName_name_{0}\", Mode = CacheTargetType.Redis)]\n```\n      \n\u003cbr/\u003e\nHow to add the cache KEY\n   \u003cbr/\u003e\nOn the business model attribute to add, the following features, can support multiple\n   \u003cbr/\u003e\n   \n```C# \n[CacheKey(1)]\n```\n        \n\u003cbr/\u003e\nConfiguring Interceptors\n\u003cbr/\u003e\n   \n```C# \n .AddClientIntercepted(typeof(CacheProviderInterceptor))\n```\n\nIDE:Visual Studio 2017 15.3 Preview ,vscode\n\u003cbr/\u003e\nThe framework：.NET core 2.0\n\u003cbr/\u003e\n如有任何问题可以加入QQ群：542283494 Gitter:not room\n\u003cbr/\u003e\n[Blog]:https://www.cnblogs.com/fanliang11\n","funding_links":[],"categories":["C\\#","C# #"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosurging%2Fsurging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosurging%2Fsurging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosurging%2Fsurging/lists"}