All Projects → brucehu123 → Study.Microservices

brucehu123 / Study.Microservices

Licence: MIT License
一步一步,由浅入深,学习如何使用.net core搭建微服务框架。

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Study.Microservices

doteasy.rpc
Inspired by microservices, a lightweight framework that looks like a rabbit, based on NET Core 2.0 Standard 2 core library
Stars: ✭ 62 (+244.44%)
Mutual labels:  consul, rpc, netcore, dotnetty
Uragano
Uragano, A simple, high performance RPC library. Support load balancing, circuit breaker, fallback, caching, intercepting.
Stars: ✭ 28 (+55.56%)
Mutual labels:  consul, polly, dotnetty
Jimu
.netcore micro service framework
Stars: ✭ 315 (+1650%)
Mutual labels:  consul, rpc
Javaspringbootsamples
SpringBoot、Dubbo、SpringCloud的各种集成例子:Atomikos、gRPC、Thrift、Seata、ShardingSphere、Dubbo、Hmily、Nacos、Consul、Ribbon、Jedis、Lettuce、Redisson等框架
Stars: ✭ 399 (+2116.67%)
Mutual labels:  consul, rpc
Spring Dubbo Service
微服务 spring dubbo项目:dubbo rpc;druid数据源连接池;mybatis配置集成,多数据源;jmx监控MBean;定时任务;aop;ftp;测试;Metrics监控;参数验证;跨域处理;shiro权限控制;consul服务注册,发现;redis分布式锁;SPI服务机制;cat监控;netty服务代理;websocket;disconf;mongodb集成;rest;docker;fescar
Stars: ✭ 224 (+1144.44%)
Mutual labels:  consul, rpc
Sharer
Arduino & .NET serial communication library to read/write variables and remote call functions using the Sharer protocol. Works on Windows, Linux and MacOS.
Stars: ✭ 21 (+16.67%)
Mutual labels:  rpc, netcore
Notlitecode
Remote Encrypted Procedure Calling for .Net & .Net Core
Stars: ✭ 16 (-11.11%)
Mutual labels:  rpc, netcore
Core Grpc
C# Grpc驱动封装,基于Consul实现服务注册服务发现,支持dotnetcore / framework,可快速实现基于Grpc的微服务,内部有完整案例,包含服务端Server 客户端 Client,core+grpc, netcore+grpc, dotnetcore+grpc
Stars: ✭ 209 (+1061.11%)
Mutual labels:  consul, netcore
Gb28181.solution
Linux/Win/Docker/kubernetes/Chart/Kustomize/GB28181/SIP/RTP/SDP/WebRTC/作为上下级域/平台级联互联
Stars: ✭ 323 (+1694.44%)
Mutual labels:  rpc, netcore
coreipc
WCF-like service model API for communication over named pipes and TCP. .NET and node.js clients.
Stars: ✭ 22 (+22.22%)
Mutual labels:  rpc, netcore
Library
A microservice project using .NET Core 2.0, DDD, CQRS, Event Sourcing, Redis and RabbitMQ
Stars: ✭ 122 (+577.78%)
Mutual labels:  consul, netcore
bounded-disturbances
A k6/.NET red/green load testing workshop
Stars: ✭ 39 (+116.67%)
Mutual labels:  netcore, polly
Winton.extensions.configuration.consul
Enables Consul to be used as a configuration source in dotnet core applications
Stars: ✭ 239 (+1227.78%)
Mutual labels:  consul, netcore
Grpc.Extensions
Grpc扩展是一个基于GRPC的简单微服务框架
Stars: ✭ 29 (+61.11%)
Mutual labels:  consul, polly
Ark.Tools
Ark set of helper libraries
Stars: ✭ 20 (+11.11%)
Mutual labels:  netcore, polly
SockNet
The easiest and fastest way to work with sockets in C#
Stars: ✭ 42 (+133.33%)
Mutual labels:  netcore
tsrpc
A TypeScript RPC framework, with runtime type checking and serialization, support both HTTP and WebSocket. It is very suitable for website / APP / games, and absolutely comfortable to full-stack TypeScript developers.
Stars: ✭ 866 (+4711.11%)
Mutual labels:  rpc
WinReform
A simple tool to help resize and relocate stubborn windows.
Stars: ✭ 20 (+11.11%)
Mutual labels:  netcore
nomad-consult-ansible-centos
Deploy nomad & consult on centos with ansible
Stars: ✭ 17 (-5.56%)
Mutual labels:  consul
eos-client
PHP library of simple and extensible to use eos rpc and offline signature.
Stars: ✭ 43 (+138.89%)
Mutual labels:  rpc

Study.Microservices

一步一步,由浅入深,学习如何使用.net core搭建微服务框架。

第一步 使用dotnetty完成rpc


启动服务端

   var host = new HostBuilder()
                .AddRpcRuntime()
                .AddRpcServer()
                .UseDotNettyServer()
				.UseConsul()
                .ConfigureAppConfiguration((context, config) =>
                {
                    config.SetBasePath(Directory.GetCurrentDirectory());
                    config.AddJsonFile("appsettings.json", optional: true);
                    config.AddEnvironmentVariables();
                })
                 .ConfigureServices((context, services) =>
                 {
                     services.AddTransient<IUserService, UserService>();
                 })
                 .ConfigureLogging((context, logger) =>
                 {
                     logger.AddConfiguration(context.Configuration.GetSection("Logging"));
                     logger.AddConsole();
                 });

            host.RunConsoleAsync().Wait();

启动客户端

   var builder = new HostBuilder()
                .AddRpcRuntime()
                .AddRpcClient()
                .AddClientProxy()
                .UseDotNettyClient()
				.UseConsul()
                .ConfigureLogging((context, logger) =>
                {
                    logger.AddConfiguration(context.Configuration.GetSection("Logging"));
                    logger.AddConsole();
                });
                
            using (var host=builder.UseConsoleLifetime().Build())
            {
                host.Start();

                var provider = host.Services;
                var proxyGenerater = provider.GetService<IServiceProxyGenerater>();
                var remoteServices = proxyGenerater.GenerateProxys(new[] { typeof(IUserService) }).ToArray();
                var proxyFactory = provider.GetService<IServiceProxyFactory>();
                var userService = proxyFactory.CreateProxy<IUserService>(remoteServices.Single(typeof(IUserService).GetTypeInfo().IsAssignableFrom));

                Stopwatch sw = Stopwatch.StartNew();

                for (var i = 0; i < 10000; i++)
                {
                    var result = userService.GetUserNameAsync(i).Result;
                }
                sw.Stop();
                Console.WriteLine($"调用结束,耗时:{sw.ElapsedMilliseconds} 毫秒");

                host.WaitForShutdown();
            }

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].