《生产优先——从外部视角构建微服务.pdf》由会员分享,可在线阅读,更多相关《生产优先——从外部视角构建微服务.pdf(31页珍藏版)》请在三个皮匠报告上搜索。
1、Production Comes FirstAn Outside-In Approach to Building MicroservicesProduction Comes First.An Outside-In Approach to Building Microservices 2022 Hound Technology,Inc.All Rights Reserved.3Martin ThwaitesO11y Evangelist and Developer Advocate at Honeycomb.ioMartinDotNetMartinDotNeto11y.socialThis is
2、 a talk about testingLinterCompilerDeveloper TestsE2E TestsCustomer ComplaintsProduction TelemetryClassesMethodsControllers/HandlersAPI/Messages/EventsRequirement:The Product Services List Products endpoint should not return products that have no stock.Requirement:The Warehouse Service should emit m
3、essages that contain the new stock level for a product whenever an OrderPlaced message is produced by the Order Service.This is a talk about TDDThis is a talk about ObservabilityV1-22“Charity Majors,Observability Pioneer,Co-Founder of Honeycomb.ioObservability is about understanding and debugging un
4、known-unknowns;the ability to understand any inner system state just by asking questions from outside of the system.2121V1-22“Charity Majors,Observability Pioneer,Co-Founder of Honeycomb.ioObservability is about understanding and debugging unknown-unknowns;the ability to understand any inner system
5、state just by asking questions from outside of the system.2222double GetPrice(int productId)var strategy=pricingStrategies.GetForProduct(productid)var productPrice=products.GetPriceForProduct(productid)var newPrice=strategy.GetTotalPrice(productPrice)return newPriceFactvoid GetProduct_WithValidProdu
6、ct_UsesRightStrategy()var product=ecomService.GetProduct(123)Assert.Equals(201.20,product.Price)?double GetPrice(int productId)var currentSpan=tracer.getActiveSpan()var strategy=pricingStrategies.GetForProduct(productid)currentSpan.SetAttri