《Spring Microservices in Action》(Manning 2016)中文版

本书针对具备Java经验的开发者,深入讲解使用Spring Boot和Spring Cloud构建微服务应用的技术细节。涵盖微服务架构、服务发现、配置管理、负载均衡、认证授权等关键主题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

关于本书

    《Spring微服务实战》是专门为使用Java或Spring工作,并且需要实践的建议和举例说明如何建立和实施微服务应用的开发者而编写的。在编写本书的时候,我是围绕核心微服务模式,使用Spring Boot 和 Spring Cloud例子在实战中对模式进行验证。因此,你会找到具体的微服务设计模式,它几乎在每章都讨论,并且有使用Spring Boot和Spring Cloud实现该模式的例子。

本书适合读者

●  你是一位拥有java构建分布式应用程序经验的开发人员(1-3年)。

●  你了解或使用Spring(1年以上)。

●  你有兴趣学习如何构建微服务的应用。

●  你对如何使用微服务构建云应用有兴趣。

●  你想知道构建微服务应用,与Java和Spring相关的技术。

●  你对将微服务应用部署到云涉及的内容有兴趣。

章节安排

    《Spring微服务实战》包含10个章节和两个附录:

●  第1章向您介绍为什么微服务架构是一个构建应用程序重要的、实质性的方法,特别是构建基于云的应用程序。

●  第2章逐步引导您使用Spring Boot构建第一个基于REST的微服务。通过架构师、应用工程师和运维工程师的视角,指导你如何看待微服务。

●  第3章介绍使用Spring Cloud Config如何管理微服务配置。Spring Cloud Config能够帮助将服务配置信息集中存储在一个单一的仓库,并对配置信息版本实现有效的控制,且能够让所有的服务实例可重复的访问。

●  第4章向您介绍了第一种微服务路由模式:服务发现。在这一章中,您将学习到如何使用SpringCloud和Netflix的Eureka服务从客户消费服务时抽象服务的具体位置。

●  第5章讨论当一个或多个微服务实例关闭或处于被降级的状态时,保护微服务消费者的方法。本章将演示如何使用Spring Cloud和Netflix Hystrix (和Netflix Ribbon)实现调用的客户端负载均衡,断路器模式,后退模式和舱壁模式。

●  第6章涵盖了微服务路由模式:服务网关。使用Spring Cloud与Netflix的Zuul服务器,您将为所有的微服务创建单一的访问入口。我们将讨论如何使用Zuul的过滤器API对所有流经服务网关的服务,建立强制的访问策略。

●  第7章介绍了使用Spring Cloud security和OAuth2如何实现服务的认证和授权。我们将介绍建立一个OAuth2服务来保护您的服务以及在OAuth2实施过程中,如何使用JavaScript Web Tokens (JWT) 。

●  第8章介绍使用Spring Cloud Stream和Apache Kafka,如何将异步消息传递到微服务。

●  第9章展示了如何实现日志记录的常用日志模式,如日志关联分析,日志聚合和使用SpringCloud Sleuth和Zipkin进行追踪。

●  第10章是本书最重要的部分。您将本书中构建的服务,部署到Amazon弹性容器服务(ECS)中。我们还将讨论如何使用自动化工具,如Travis CI,实现微服务的自动化构建和部署。

●  附录A介绍了如何设置桌面开发环境,以便运行本书中的所有代码示例。本附录包括如何在本地构建应用程序和如果你想在本地运行代码示例,如何启动本地的Docker容器。

●  附录B是OAuth2补充材料。OAuth2是一个非常灵活的认证模型,本章简要概述了OAuth2被用于保护应用程序和对应微服务的各种方式。

关于代码

    本书包含了每一章的示例代码。所有的代码示例都可用。在我的GitHub仓库,每一章都有自己的独立库。在https://github.com/carnellj/spmia_overview概述页面,您可以找到链接到每一章代码库的链接。您可以在Manning出版社的网站上下载书中应用程序的完整源代码,地址是www.manning.com/books/spring-microservices-in-action。

    在这本书中的所有代码是运行在java 8环境下,使用Maven作为主要的构建工具。请参阅本书附录A,详细了解编译和运行代码示例所需的软件工具。

    我写这本书时所遵循的原则是,每个章节中的代码示例应该独立于其他章节中的代码示例。因此,我在每章中创建的每个服务都构建一个对应的Docker镜像。当代码被前面的章节使用,它包括源代码和一个已构建的Docker镜像。我们使用Docker compose构建Docker镜像来保证在每章中拥有一个可以重复运行的环境。

    本书包含很多源代码示例,它们使用编号列表和正常文本行显示。在这两种情况下,源代码是以固定宽度字体格式化的,以便将其与普通文本分隔开来。有时代码也会加粗突出显示区别于本章前面步骤的代码,如新功能添加到现有代码行时。

    在很多情况下,源代码已被格式化;我们添加了换行符和重做缩进来调整书中可用的页面空间。在少数情况下,列表中包含了行延续标记()。此外,在文本中描述代码时,源代码中的注释常常被从清单中删除。代码注释伴随许多的列表,突出重要概念。

作者在线

    购买本书的读者还能免费访问Manning出版社的私有Web论坛,在那里你能就本书发表评论,询问技术问题,向作者以及其他用户寻求帮助。如需访问并订阅该论坛,请打开浏览器访问www.manning.com/books/spring-microservices-in-action。该页面提供了详细的信息,告诉你在注册后如何访问论坛,论坛里都能提供哪些帮助,以及论坛的管理规则。

    Manning向读者承诺,为读者与读者之间以及读者与作者之间的沟通建立桥梁。但Manning并不保证作者在论坛中的参与程度,他们在论坛上投入多少精力是全凭自愿的(并且是无偿的)。我们强烈建议你向作者问些有挑战性的问题,让他有兴趣留在论坛里。

中文文档下载地址(PDF格式)

百度网盘:https://pan.baidu.com/s/1BlP7zvcBkYgQ-uK9I4dNEg 密码: e45d

 

Spring Microservices in Action consists of 10 chapters and two appendixes: Chapter 1 introduces you to why the microservices architecture is an important and relevant approach to building applications, especially cloud-based applications. Chapter 2 walks you through how to build your first REST-based microservice using Spring Boot. This chapter will guide you in how to look at your microser- vices through the eyes of an architect, an application engineer, and a DevOps engineer. Chapter 3 introduces you to how to manage the configuration of your microser- vices using Spring Cloud Config. Spring Cloud Config helps you guarantee that your service’s configuration information is centralized in a single repository, versioned and repeatable across all instances of your services. Chapter 4 introduces you to one of the first microservice routing patterns: ser- vice discovery. In this chapter, you’ll learn how to use Spring Cloud and Net- flix’s Eureka service to abstract away the location of your services from the clients consuming them. Chapter 5 is all about protecting the consumers of your microservices when one or more microservice instances is down or in a degraded state. This chapter will demonstrate how to use Spring Cloud and Netflix Hystrix (and Netflix Ribbon) to implement client-side load balancing of calls, the circuit breaker pattern, the fallback pattern, and the bulkhead pattern. Chapter 6 covers the microservice routing pattern: the service gateway. Using Spring Cloud with Netflix’s Zuul server, you’ll build a single entry point for all microservices to be called through. We’ll discuss how to use Zuul’s filter API to build policies that can be enforced against all services flowing through the ser- vice gateway. Chapter 7 covers how to implement service authentication and authorization using Spring Cloud security and OAuth2. We’ll cover the basics of setting up an OAuth2 service to protect your services and also how to use JavaScript Web Tokens (JWT) in your OAuth2 implementation. Chapter 8 looks at how you can introduce asynchronous messaging into your microservices using Spring Cloud Stream and Apache Kafka. Chapter 9 shows how to implement common logging patterns such as log corre- lation, log aggregation, and tracing using Spring Cloud Sleuth and Open Zipkin. Chapter 10 is the cornerstone project for the book. You’ll take the services you’ve built in the book and deploy them to Amazon Elastic Container Service (ECS). We’ll also discuss how to automate the build and deployment of your microservices using tools such as Travis CI. Appendix A covers how to set up your desktop development environment so that you can run all the code examples in this book. This appendix covers how the local build process works and also how to start up Docker locally if you want to run the code examples locally. Appendix B is supplemental material on OAuth2. OAuth2 is an extremely flexi- ble authentication model, and this chapter provides a brief overview of the dif- ferent manners in which OAuth2 can be used to protect an application and its corresponding microservices.
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值