舉報

會員
Mastering Microservices with Java
Sourabh Sharma 著
更新時間:2021-07-02 13:04:25
開會員,本書免費讀 >
Microservicesarekeytodesigningscalable,easy-to-maintainapplications.ThislatesteditionofMasteringMicroserviceswithJava,worksonJava11.Itcoversawiderangeofexcitingnewdevelopmentsintheworldofmicroservices,includingmicroservicespatterns,interprocesscommunicationwithgRPC,andserviceorchestration.Thisbookwillhelpyouunderstandhowtoimplementmicroservice-basedsystemsfromscratch.You'llstartoffbyunderstandingthecoreconceptsandframework,beforefocusingonthehigh-leveldesignoflargesoftwareprojects.You'llthenuseSpringSecuritytosecuremicroservicesandtestthemeffectivelyusingRESTJavaclientsandothertools.YouwillalsogainexperienceofusingtheNetflixOSSsuite,comprisingtheAPIGateway,servicediscoveryandregistration,andCircuitBreaker.Additionally,you'llbeintroducedtothebestpatterns,practices,andcommonprinciplesofmicroservicedesignthatwillhelpyoutounderstandhowtotroubleshootanddebugtheissuesfacedduringdevelopment.Bytheendofthisbook,you'llhavelearnedhowtobuildsmaller,lighter,andfasterservicesthatcanbeimplementedeasilyinaproductionenvironment.
最新章節
- Leave a review - let other readers know what you think
- Other Books You May Enjoy
- Further reading
- Summary
- How to accommodate a new functionality during migration
- Migrating modules to microservices
品牌:中圖公司
上架時間:2021-07-02 12:25:39
出版社:Packt Publishing
本書數字版權由中圖公司提供,并由其授權上海閱文信息技術有限公司制作發行
- Leave a review - let other readers know what you think 更新時間:2021-07-02 13:04:25
- Other Books You May Enjoy
- Further reading
- Summary
- How to accommodate a new functionality during migration
- Migrating modules to microservices
- Standalone user interface applications
- Pilot project
- Process automation and tools setup
- Incremental migration
- Approaches and keys to successful migration
- Both cloud and on-premise solution
- On-premise only solution
- Cloud-only solution
- Cloud versus on-premise versus both cloud and on-premise
- Do you need to migrate?
- Converting a Monolithic App to a Microservice-Based App
- Further reading
- Summary
- Scheduler for Apache Mesos – Fenzo
- Distributed configuration management – Archaius
- On-host performance monitoring – Vector
- AWS resource monitoring – Edda
- Reliability monitoring service – Simian Army
- Operational monitoring – Atlas
- Edge (proxy) server – Zuul
- Circuit breaker – Hystrix
- Service communication – Ribbon
- Service registration and discovery – Eureka
- Deployment and delivery – Spinnaker with Aminator
- Build – Nebula
- Netflix Open Source Software (OSS)
- Microservice frameworks and tools
- Transaction boundaries
- A separate data store for each microservice
- Self-monitoring and logging
- System/end-to-end test automation
- Continuous integration and continuous deployment (CI/CD)
- Nanoservice size and monolithic
- Best practices and principles
- Overview and mindset
- Best Practices and Common Principles
- Further reading
- Summary
- Let's explore more
- Maintaining different versions
- Analyzing dependencies while designing the system
- Cyclic dependencies and their impact
- Dependencies and versions
- Using Zipkin and Sleuth for tracking
- Let's see how we can tackle this problem
- Using a correlation ID for service calls
- Tips for ELK Stack implementation
- Pushing logs to the ELK Stack
- Running the ELK Stack using Docker Compose
- Installing Kibana
- Installing Logstash
- Installing Elasticsearch
- ELK Stack setup
- Kibana
- Logstash
- Elasticsearch
- A brief overview
- Logging and the ELK Stack
- Troubleshooting Guide
- Further reading
- Summary
- Execution of sample workflow
- Starting workflow and providing input
- Using Conductor system tasks such as DECISION
- Wiring input and output
- The Conductor worker
- WorkflowDef (blueprint of workflows)
- Task definitions (blueprint of tasks)
- Basic setup
- The Conductor client
- High-level architecture
- Orchestration implementation with Netflix Conductor
- Orchestration
- Choreography
- Choreography and orchestration
- Service Orchestration
- Further reading
- Summary
- Billing service changes
- Booking service changes
- Compensating transaction in the booking service
- Saga reference implementations
- Distributed saga implementation
- Routing slips
- Distributed sagas
- Feral Concurrency Control
- Distributed sagas and compensating transaction
- Implementation
- Completion phase
- Voting phase
- Two-phase commit (2PC)
- Second approach
- First approach
- Design Iteration
- Transaction Management
- Section 4: Common Problems and Best Practices
- Further reading
- Summary
- Consuming the event
- Producing an event
- Implementing event-based microservices
- Message driven
- Elastic
- Resilient
- Responsive
- An overview of the event-based microservice architecture
- Inter-Process Communication Using Events
- Further reading
- Summary
- The gRPC-based client
- The gRPC server
- Service interface and implementation
- Basic setup
- The gRPC-based server
- Protocol Buffer
- gRPC framework overview
- Can I call gRPC server from UI apps?
- REST versus gRPC
- gRPC features
- An overview of gRPC
- Inter-Process Communication Using gRPC
- Further reading
- Summary
- Wrapping it up
- Java 11 HTTPClient
- OpenFeign client implementation
- RestTemplate implementation
- Load balanced calls and RestTemplate implementation
- REST and inter-process communication
- Inter-Process Communication Using REST
- Section 3: Inter-Process Communication
- Further reading
- Summary
- Reservation confirmation
- restaurant.component.html (restaurant details and reservation HTML template)
- restaurant.component.ts (the restaurant details and reservation page)
- Restaurant details with a reservation option
- login.component.ts
- login.component.html (login template)
- Login page
- Searching for restaurants
- src/restaurants/restaurants.component.html (the restaurants list HTML template)
- src/restaurants/restaurants.component.ts (the restaurants list script)
- Restaurants list page
- app.component.html (the root component HTML template)
- app.component.ts (the root component)
- src/auth.guard.ts (Auth Guard)
- src/rest.service.ts (the REST client service)
- src/app-routing.module.ts (the routing module)
- src/app.module.ts (AppModule)
- The home page
- Developing OTRS features
- Guard
- Directives
- Routing
- Services and dependency injection (DI)
- Components
- Modules (NgModules)
- Angular architecture
- MVC and MVVM
- Angular framework overview
- Setting up a UI application
- Consuming Services Using the Angular App
- Further reading
- Summary
- Client credentials grant
- Resource owner password credential grant
- Implicit grant
- Using the access token to access the APIs
- Authorization code grant
- API Gateway as a resource server
- Security microservice
- OAuth implementation using Spring Security
- Client credentials grant
- Resource owner password credentials grant
- Implicit grant
- Authorization code grant
- OAuth 2.0 grant types
- Redirection endpoint
- Token endpoint
- Authorization endpoint
- OAuth 2.0 protocol endpoints
- Client authentication
- Client identifier
- Client profiles
- Client types
- OAuth 2.0 client registration
- Authorization server
- Client
- Resource server
- Resource owner
- OAuth 2.0 roles
- OAuth 2.0 specification – concise details
- Uses of OAuth
- OAuth 2.0
- Authentication and authorization
- Secure Socket Layer
- Securing Microservices
- Further reading
- Summary
- Grafana
- Integration with api-service
- Architecture
- Prometheus
- Enabling monitoring
- Centralized monitoring
- Demo execution
- Implementing Hystrix's fallback method
- Circuit breaker
- Demo execution
- Implementation
- Edge server and API gateway
- The overall architecture
- Microservice Patterns - Part 2
- References
- Summary
- Execution and testing of the containerized OTRS app
- Spring Cloud Config client
- Spring Cloud Config Server
- Centralized configuration
- Spring Cloud Netflix Eureka client
- Implementation
- Spring Cloud Netflix Eureka Server
- Service discovery and registration
- Microservice Patterns - Part 1
- Section 2: Microservice Patterns Security and UI
- Summary
- Executing Docker Compose
- Managing Docker containers
- Integration testing with Docker
- Running Docker using Maven
- Building Docker images with Maven
- Docker Machine with 4 GB of memory
- Installation and configuration
- Microservice deployment using containers
- Testing
- Execution
- Booking and user services
- Entity classes
- Repository classes
- Service classes
- API versioning
- Controller class
- Restaurant service implementation
- OTRS implementation
- Restaurant microservice
- Developing and implementing microservices
- OTRS overview
- Implementing a Microservice
- Summary
- Service implementation
- Repository implementation
- Entity implementation
- Sample domain service
- Distillation
- Open Host Service
- Separate ways
- Anti-corruption layer
- Conformist
- Customer-supplier
- Shared kernel
- Context map
- Continuous integration
- Bounded context
- Strategic design and principles
- Modules
- Factory
- Repository
- Aggregates
- Services
- Value objects
- Entities
- Artifacts of DDD
- Infrastructure layer
- Domain layer
- Application layer
- Presentation layer
- Multilayered architecture
- Ubiquitous language
- Building blocks
- The fundamentals of DDD
- Domain-driven design (DDD) fundamentals
- Domain-Driven Design
- Further reading
- Summary
- Negative test scenarios
- Some more positive test scenarios
- Testing using Postman
- Maven build from the Command Prompt
- Running the Maven build from IDE
- Maven build
- An embedded web server
- Making a sample RESTapplication executable
- The @PathVariable annotation
- The @RequestParam annotation
- The @RequestMapping annotation
- The @RestController annotation
- Writing the REST controller class
- REST
- Adding Spring Boot to our main project
- Spring Boot
- Environment Setup
- Summary
- Deployment
- Docker's architecture
- Docker
- Containers
- Deployment using a containerization engine such as Docker
- Microservices build pipeline
- Deployment and maintenance
- Serverless
- Teraservices
- Nanoservices
- Ease of development – could be done better
- Alignment with agile practices
- Problems in adopting new technologies
- Release rollback in case of failure
- One-dimension scalability
- Microservices nanoservices teraservices and serverless
- Monolithic design with services
- Traditional monolithic design
- Limitations of monolithic architectures versus its solution with microservices architectures
- Monolithic architecture overview
- Services and SOA
- A Solution Approach
- Section 1: Fundamentals
- Reviews
- Get in touch
- Conventions used
- Download the color images
- Download the example code files
- To get the most out of this book
- What this book covers
- Who this book is for
- Preface
- Packt is searching for authors like you
- About the reviewer
- About the author
- Contributors
- Packt.com
- Why subscribe?
- About Packt
- Dedication
- Mastering Microservices with Java Third Edition
- Copyright and Credits
- Title Page
- coverpage
- coverpage
- Title Page
- Copyright and Credits
- Mastering Microservices with Java Third Edition
- Dedication
- About Packt
- Why subscribe?
- Packt.com
- Contributors
- About the author
- About the reviewer
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Download the color images
- Conventions used
- Get in touch
- Reviews
- Section 1: Fundamentals
- A Solution Approach
- Services and SOA
- Monolithic architecture overview
- Limitations of monolithic architectures versus its solution with microservices architectures
- Traditional monolithic design
- Monolithic design with services
- Microservices nanoservices teraservices and serverless
- One-dimension scalability
- Release rollback in case of failure
- Problems in adopting new technologies
- Alignment with agile practices
- Ease of development – could be done better
- Nanoservices
- Teraservices
- Serverless
- Deployment and maintenance
- Microservices build pipeline
- Deployment using a containerization engine such as Docker
- Containers
- Docker
- Docker's architecture
- Deployment
- Summary
- Environment Setup
- Spring Boot
- Adding Spring Boot to our main project
- REST
- Writing the REST controller class
- The @RestController annotation
- The @RequestMapping annotation
- The @RequestParam annotation
- The @PathVariable annotation
- Making a sample RESTapplication executable
- An embedded web server
- Maven build
- Running the Maven build from IDE
- Maven build from the Command Prompt
- Testing using Postman
- Some more positive test scenarios
- Negative test scenarios
- Summary
- Further reading
- Domain-Driven Design
- Domain-driven design (DDD) fundamentals
- The fundamentals of DDD
- Building blocks
- Ubiquitous language
- Multilayered architecture
- Presentation layer
- Application layer
- Domain layer
- Infrastructure layer
- Artifacts of DDD
- Entities
- Value objects
- Services
- Aggregates
- Repository
- Factory
- Modules
- Strategic design and principles
- Bounded context
- Continuous integration
- Context map
- Shared kernel
- Customer-supplier
- Conformist
- Anti-corruption layer
- Separate ways
- Open Host Service
- Distillation
- Sample domain service
- Entity implementation
- Repository implementation
- Service implementation
- Summary
- Implementing a Microservice
- OTRS overview
- Developing and implementing microservices
- Restaurant microservice
- OTRS implementation
- Restaurant service implementation
- Controller class
- API versioning
- Service classes
- Repository classes
- Entity classes
- Booking and user services
- Execution
- Testing
- Microservice deployment using containers
- Installation and configuration
- Docker Machine with 4 GB of memory
- Building Docker images with Maven
- Running Docker using Maven
- Integration testing with Docker
- Managing Docker containers
- Executing Docker Compose
- Summary
- Section 2: Microservice Patterns Security and UI
- Microservice Patterns - Part 1
- Service discovery and registration
- Spring Cloud Netflix Eureka Server
- Implementation
- Spring Cloud Netflix Eureka client
- Centralized configuration
- Spring Cloud Config Server
- Spring Cloud Config client
- Execution and testing of the containerized OTRS app
- Summary
- References
- Microservice Patterns - Part 2
- The overall architecture
- Edge server and API gateway
- Implementation
- Demo execution
- Circuit breaker
- Implementing Hystrix's fallback method
- Demo execution
- Centralized monitoring
- Enabling monitoring
- Prometheus
- Architecture
- Integration with api-service
- Grafana
- Summary
- Further reading
- Securing Microservices
- Secure Socket Layer
- Authentication and authorization
- OAuth 2.0
- Uses of OAuth
- OAuth 2.0 specification – concise details
- OAuth 2.0 roles
- Resource owner
- Resource server
- Client
- Authorization server
- OAuth 2.0 client registration
- Client types
- Client profiles
- Client identifier
- Client authentication
- OAuth 2.0 protocol endpoints
- Authorization endpoint
- Token endpoint
- Redirection endpoint
- OAuth 2.0 grant types
- Authorization code grant
- Implicit grant
- Resource owner password credentials grant
- Client credentials grant
- OAuth implementation using Spring Security
- Security microservice
- API Gateway as a resource server
- Authorization code grant
- Using the access token to access the APIs
- Implicit grant
- Resource owner password credential grant
- Client credentials grant
- Summary
- Further reading
- Consuming Services Using the Angular App
- Setting up a UI application
- Angular framework overview
- MVC and MVVM
- Angular architecture
- Modules (NgModules)
- Components
- Services and dependency injection (DI)
- Routing
- Directives
- Guard
- Developing OTRS features
- The home page
- src/app.module.ts (AppModule)
- src/app-routing.module.ts (the routing module)
- src/rest.service.ts (the REST client service)
- src/auth.guard.ts (Auth Guard)
- app.component.ts (the root component)
- app.component.html (the root component HTML template)
- Restaurants list page
- src/restaurants/restaurants.component.ts (the restaurants list script)
- src/restaurants/restaurants.component.html (the restaurants list HTML template)
- Searching for restaurants
- Login page
- login.component.html (login template)
- login.component.ts
- Restaurant details with a reservation option
- restaurant.component.ts (the restaurant details and reservation page)
- restaurant.component.html (restaurant details and reservation HTML template)
- Reservation confirmation
- Summary
- Further reading
- Section 3: Inter-Process Communication
- Inter-Process Communication Using REST
- REST and inter-process communication
- Load balanced calls and RestTemplate implementation
- RestTemplate implementation
- OpenFeign client implementation
- Java 11 HTTPClient
- Wrapping it up
- Summary
- Further reading
- Inter-Process Communication Using gRPC
- An overview of gRPC
- gRPC features
- REST versus gRPC
- Can I call gRPC server from UI apps?
- gRPC framework overview
- Protocol Buffer
- The gRPC-based server
- Basic setup
- Service interface and implementation
- The gRPC server
- The gRPC-based client
- Summary
- Further reading
- Inter-Process Communication Using Events
- An overview of the event-based microservice architecture
- Responsive
- Resilient
- Elastic
- Message driven
- Implementing event-based microservices
- Producing an event
- Consuming the event
- Summary
- Further reading
- Section 4: Common Problems and Best Practices
- Transaction Management
- Design Iteration
- First approach
- Second approach
- Two-phase commit (2PC)
- Voting phase
- Completion phase
- Implementation
- Distributed sagas and compensating transaction
- Feral Concurrency Control
- Distributed sagas
- Routing slips
- Distributed saga implementation
- Saga reference implementations
- Compensating transaction in the booking service
- Booking service changes
- Billing service changes
- Summary
- Further reading
- Service Orchestration
- Choreography and orchestration
- Choreography
- Orchestration
- Orchestration implementation with Netflix Conductor
- High-level architecture
- The Conductor client
- Basic setup
- Task definitions (blueprint of tasks)
- WorkflowDef (blueprint of workflows)
- The Conductor worker
- Wiring input and output
- Using Conductor system tasks such as DECISION
- Starting workflow and providing input
- Execution of sample workflow
- Summary
- Further reading
- Troubleshooting Guide
- Logging and the ELK Stack
- A brief overview
- Elasticsearch
- Logstash
- Kibana
- ELK Stack setup
- Installing Elasticsearch
- Installing Logstash
- Installing Kibana
- Running the ELK Stack using Docker Compose
- Pushing logs to the ELK Stack
- Tips for ELK Stack implementation
- Using a correlation ID for service calls
- Let's see how we can tackle this problem
- Using Zipkin and Sleuth for tracking
- Dependencies and versions
- Cyclic dependencies and their impact
- Analyzing dependencies while designing the system
- Maintaining different versions
- Let's explore more
- Summary
- Further reading
- Best Practices and Common Principles
- Overview and mindset
- Best practices and principles
- Nanoservice size and monolithic
- Continuous integration and continuous deployment (CI/CD)
- System/end-to-end test automation
- Self-monitoring and logging
- A separate data store for each microservice
- Transaction boundaries
- Microservice frameworks and tools
- Netflix Open Source Software (OSS)
- Build – Nebula
- Deployment and delivery – Spinnaker with Aminator
- Service registration and discovery – Eureka
- Service communication – Ribbon
- Circuit breaker – Hystrix
- Edge (proxy) server – Zuul
- Operational monitoring – Atlas
- Reliability monitoring service – Simian Army
- AWS resource monitoring – Edda
- On-host performance monitoring – Vector
- Distributed configuration management – Archaius
- Scheduler for Apache Mesos – Fenzo
- Summary
- Further reading
- Converting a Monolithic App to a Microservice-Based App
- Do you need to migrate?
- Cloud versus on-premise versus both cloud and on-premise
- Cloud-only solution
- On-premise only solution
- Both cloud and on-premise solution
- Approaches and keys to successful migration
- Incremental migration
- Process automation and tools setup
- Pilot project
- Standalone user interface applications
- Migrating modules to microservices
- How to accommodate a new functionality during migration
- Summary
- Further reading
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-07-02 13:04:25