随笔分类 - 微服务系列
应用.NetCore 3.1构建一套完整的微服务网站
摘要:什么是Azure服务总线? Azure服务总线是完全托管的企业消息代理,包括消息队列和发布订阅(命名空间). Service Bus通常被用来解耦应用程序和服务,控制跨服务和应用程序间安全路由和传输数据。 本篇从实战出发介绍如何通过Service Bus发送接收及消费消息。 项目介绍:创建了5个工程
阅读全文
摘要:Ocelot supports some very rudimentary caching at the moment provider by the CacheManager project. This s an amazing project that is solving a lot of c
阅读全文
摘要:Ocelot supports claims based authorization which is run post authentication. This means if ou have a route you want to authorize you can add the follo
阅读全文
摘要:Qos quality of service Ocelot supports one Qos capability at the current time.You can set on a per Route basis if you want to use a circuit breaker wh
阅读全文
摘要:Ocelot can load balance across available downstream services for each Route. This means you can scale your downstream services and Ocelot can use them
阅读全文
摘要:In order to authenticate Routes and subsequently use any of Ocelot's claims based features such as authorization or modifying the request with values
阅读全文
摘要:Ocelot supports rate limiting of upstream requests so that your downstream services do not become overloaded. OK so to get rate limiting working for a
阅读全文
摘要:当你的应用程序需要在多语言环境下运行时,资源文件(Resource)是必不可少的,ASP.NET Core 提供了一种基于资源文件(*.resx)的多语言实现方式,详细配置如下: 1、首先在application中添加测试资源文件 2、在Startup ConfigureServices中注册本地化
阅读全文
摘要:在netcore中jwt使用场景很多,网上有很多的资料,这里不再累述,之后有机会会单独介绍,今天主要以实战为主。 1、create jwt token 1 public interface IJwtTokenService 2 { 3 string GetJwtToken(); 4 } 5 6 pu
阅读全文
摘要:Ocelot是一个用.NET Core实现并且开源的API网关,功能包括:路由,请求聚合,服务验证,鉴权,限流熔断,并内置了负载均衡器与Service Fabric,Buttefly Tracing集成。这些功能都只需要简单配置就可以完成。 简单的ocelot是一堆asp.net core midd
阅读全文
摘要:Ocelot允许声明聚合路由,把多个Routes请求batch一个对象来对客户端的请求进行响应。 1、ocelot configuration { "DownstreamPathTemplate": "/api/service1", "DownstreamScheme": "https", "Dow
阅读全文
摘要:如何使用Dispatchproxy封装REST API,让API调用更简单。 1、创建HttpClientDispathProxy类继承自DispatchProxy public class HttpClientDispathProxy<TInterface> : DispatchProxy { p
阅读全文
摘要:Consul 是HashiCorp公司推出的开源工具,用于实现分布式系统的服务发现与配置,内置了服务注册发现框架,分布式一致性实现,健康检查,负载均衡,服务治理,多数据中心方案等。Consul用GoLang语言实现,因此具有天然可移植性(支持Linux,Window和Mac OS),安装包仅包含一个
阅读全文