随笔分类 -  微服务系列

应用.NetCore 3.1构建一套完整的微服务网站
摘要:什么是Azure服务总线? Azure服务总线是完全托管的企业消息代理,包括消息队列和发布订阅(命名空间). Service Bus通常被用来解耦应用程序和服务,控制跨服务和应用程序间安全路由和传输数据。 本篇从实战出发介绍如何通过Service Bus发送接收及消费消息。 项目介绍:创建了5个工程 阅读全文
posted @ 2023-10-27 13:42 云霄宇霁 阅读(102) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-10-09 15:48 云霄宇霁 阅读(74) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-10-09 10:49 云霄宇霁 阅读(58) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-10-08 18:57 云霄宇霁 阅读(53) 评论(0) 推荐(0)
摘要:Ocelot can load balance across available downstream services for each Route. This means you can scale your downstream services and Ocelot can use them 阅读全文
posted @ 2023-10-08 18:24 云霄宇霁 阅读(136) 评论(0) 推荐(0)
摘要:In order to authenticate Routes and subsequently use any of Ocelot's claims based features such as authorization or modifying the request with values 阅读全文
posted @ 2023-10-08 17:18 云霄宇霁 阅读(110) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-10-08 14:51 云霄宇霁 阅读(133) 评论(0) 推荐(0)
摘要:当你的应用程序需要在多语言环境下运行时,资源文件(Resource)是必不可少的,ASP.NET Core 提供了一种基于资源文件(*.resx)的多语言实现方式,详细配置如下: 1、首先在application中添加测试资源文件 2、在Startup ConfigureServices中注册本地化 阅读全文
posted @ 2023-03-04 09:37 云霄宇霁 阅读(263) 评论(0) 推荐(0)
摘要:在netcore中jwt使用场景很多,网上有很多的资料,这里不再累述,之后有机会会单独介绍,今天主要以实战为主。 1、create jwt token 1 public interface IJwtTokenService 2 { 3 string GetJwtToken(); 4 } 5 6 pu 阅读全文
posted @ 2023-03-04 09:36 云霄宇霁 阅读(149) 评论(0) 推荐(0)
摘要:Ocelot是一个用.NET Core实现并且开源的API网关,功能包括:路由,请求聚合,服务验证,鉴权,限流熔断,并内置了负载均衡器与Service Fabric,Buttefly Tracing集成。这些功能都只需要简单配置就可以完成。 简单的ocelot是一堆asp.net core midd 阅读全文
posted @ 2023-03-04 09:36 云霄宇霁 阅读(247) 评论(0) 推荐(0)
摘要:Ocelot允许声明聚合路由,把多个Routes请求batch一个对象来对客户端的请求进行响应。 1、ocelot configuration { "DownstreamPathTemplate": "/api/service1", "DownstreamScheme": "https", "Dow 阅读全文
posted @ 2023-03-04 09:36 云霄宇霁 阅读(72) 评论(0) 推荐(0)
摘要:如何使用Dispatchproxy封装REST API,让API调用更简单。 1、创建HttpClientDispathProxy类继承自DispatchProxy public class HttpClientDispathProxy<TInterface> : DispatchProxy { p 阅读全文
posted @ 2023-03-04 09:35 云霄宇霁 阅读(99) 评论(0) 推荐(1)
摘要:Consul 是HashiCorp公司推出的开源工具,用于实现分布式系统的服务发现与配置,内置了服务注册发现框架,分布式一致性实现,健康检查,负载均衡,服务治理,多数据中心方案等。Consul用GoLang语言实现,因此具有天然可移植性(支持Linux,Window和Mac OS),安装包仅包含一个 阅读全文
posted @ 2023-02-07 20:39 云霄宇霁 阅读(97) 评论(0) 推荐(0)
摘要:Client Credential Workflow(工作流) 这是一个比较基础的解决方案用IdentityServer保护Resource APIs,在这个工程中定义API和一个访问API的client客户端。Client客户端从IdentityServer获取access token用clien 阅读全文
posted @ 2021-03-26 08:36 云霄宇霁 阅读(170) 评论(0) 推荐(0)
摘要:基本概念: QPS:Queries Per Second意思是“每秒查询率” ,是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。 TPS:Transaction Per Second意思是“事务数/秒”,是软件测试结果的衡量单位。一个事务是指一个客户 阅读全文
posted @ 2017-03-23 09:56 云霄宇霁 阅读(810) 评论(0) 推荐(0)