3 options
Building RESTful web services with Spring 5 : leverage the power of Spring 5.0, Java SE 9, and Spring Boot 2.0. / Raja CSP Raman, Ludovic Dewailly.
- Format:
- Book
- Author/Creator:
- Raman, Raja CSP, author.
- Dewailly, Ludovic, author.
- Language:
- English
- Subjects (All):
- Application software--Development.
- Application software.
- Physical Description:
- 1 online resource (228 pages)
- Edition:
- Second edition.
- Other Title:
- Leverage the power of Spring 5.0, Java SE 9, and Spring Boot 2.0
- Place of Publication:
- Birmingham, England : Packt Publishing, 2018.
- System Details:
- text file
- Summary:
- Find out how to implement the REST architecture to build resilient software in Java with the help of the Spring 5.0 framework. About This Book Follow best practices and explore techniques such as clustering and caching to achieve a reactive, scalable web service, Leverage the Spring Framework to quickly implement RESTful endpoints, Learn to implement a client library for a RESTful web service using the Spring Framework along with the new front end framework. Who This Book Is For This book is intended for those who want to learn to build RESTful web services with the latest Spring 5.0 Framework. To make best use of the code samples included in the book, you should have a basic knowledge of the Java language. Previous experience with the Spring Framework would also help you get up and running quickly. What You Will Learn Deep dive into the principles behind REST Expose CRUD operations through RESTful endpoints with the Spring Framework Devise response formats and error handling strategies, offering a consistent and flexible structure to simplify integration for service consumers Follow the best approaches for dealing with a service's evolution while maintaining backward compatibility Understand techniques to secure web services Comply with the best ways to test RESTful web services, including tips for load testing Optimise and scale web services using techniques such as caching and clustering In Detail REST is an architectural style that tackles the challenges of building scalable web services. In today's connected world, APIs have taken a central role on the web. APIs provide the fabric through which systems interact, and REST has become synonymous with APIs.The depth, breadth, and ease of use of Spring makes it one of the most attractive frameworks in the Java ecosystem. Marrying the two technologies is therefore a very natural choice.This book takes you through the design of RESTful web services and leverages the Spring Framework to implement these services. Starting from the basics of the philosophy behind REST, you'll go through the steps of designing and implementing an enterprise-grade RESTful web service. Taking a practical approach, each chapter provides code samples that you can apply to your own circumstances.This second edition brings forth the power of the latest Spring 5.0 release, working with MVC built-in as well as the front end framework. It then goes beyond the use of Spring to explores approaches to tackle resilience, securit...
- Contents:
- Cover
- Title Page
- Copyright and Credits
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: A Few Basics
- REST - a basic understanding
- Uniform interface
- Client and server
- Stateless
- Cacheable
- Layered system
- Code on demand (COD)
- More on REST
- Imperative and Reactive programming
- Reactive Streams
- Benefits of Reactive programming
- Reactive programming in Java and Spring 5
- Our RESTful web service architecture
- Summary
- Chapter 2: Building RESTful Web Services in Spring 5 with Maven
- Apache Maven
- Creating a project with Maven
- Viewing a POM file after creating a project
- POM file structure
- Understanding POM dependencies
- Adding Log4j 2.9.1 to POM dependency
- Dependency trees
- Spring Boot
- Developing RESTful web services
- Creating a project base
- Working with your favorite IDE
- Chapter 3: Flux and Mono (Reactor Support) in Spring
- Reactive Core and Streams
- Back pressures and Reactive Streams
- WebFlux
- Basic REST API
- Flux
- Mono
- User class with Reactive - REST
- Chapter 4: CRUD Operations in Spring REST
- CRUD operations in Spring REST
- HTTP methods
- Reactive server initialization
- Sample values in the repository
- getAllUsers - mapping
- getAllUsers - implementation in the handler and repository
- Testing the endpoint - getAllUsers
- getUser - implementation in the handler and repository
- Testing the endpoint - getUser
- createUser - implementation in the handler and repository
- Testing the endpoint - createUser
- updateUser - implementation in the handler and repository
- Testing the endpoint - updateUser
- deleteUser - implementation in the handler and repository
- Testing the endpoint - deleteUser
- Summary.
- Chapter 5: CRUD Operations in Plain REST (Without Reactive) and File Upload
- Mapping CRUD operations to HTTP methods
- Creating resources
- CRUD operation in Spring 5 (without Reactive)
- getAllUsers - implementation
- getUser - implementation
- createUser - implementation
- updateUser - implementation
- deleteUser - implementation
- File uploads - REST API
- Testing the file upload
- Chapter 6: Spring Security and JWT (JSON Web Token)
- Spring Security
- Authentication and authorization
- JSON Web Token (JWT)
- JWT dependency
- Creating a JWT token
- Generating a token
- Getting a subject from a JWT token
- Getting a subject from a token
- Chapter 7: Testing RESTful Web Services
- JUnit
- MockMvc
- Testing a single user
- Postman
- Getting all the users - Postman
- Adding a user - Postman
- Generating a JWT - Postman
- Getting the subject from the token
- SoapUI
- Getting all the users - SoapUI
- Generating JWT SoapUI
- Getting the subject from the token - SoapUI
- jsoup
- Getting a user - jsoup
- Adding a user - jsoup
- Running the test cases
- Chapter 8: Performance
- HTTP compression
- Content negotiation
- Accept-Encoding
- Content-Encoding
- Server-driven content negotiation
- Agent-driven content negotiation
- HTTP caching
- HTTP cache control
- Public caching
- Private caching
- No-cache
- Only-if-cached
- Cache validation
- ETags
- Last-Modified/If-Modified-Since headers
- Cache implementation
- The REST resource
- Caching with ETags
- Chapter 9: AOP and Logger Controls
- Aspect-oriented programming (AOP)
- AOP (@Before) with execution
- Testing AOP @Before execution
- AOP (@Before) with annotation
- Testing AOP @Before annotation
- Integrating AOP with JWT
- Logger controls
- SLF4J, Log4J, and Logback
- Logback framework.
- Logback dependency and configuration
- Logging levels
- Logback implementation in class
- Chapter 10: Building a REST Client and Error Handling
- Building a REST client
- RestTemplate
- Error handling
- Customized exception
- Chapter 11: Scaling
- Clustering
- Benefits of clustering
- Load balancing
- Scaling databases
- Vertical scaling
- Horizontal scaling
- Read replicas
- Pool connections
- Use multiple masters
- Load balancing in DB servers
- Database partitioning
- Sharding (horizontal partitioning)
- Vertical partitioning
- Distributed caching
- Data-tier caching
- First-level caching
- Second-level caching
- Application-tier caching
- Memcached
- Redis
- Hazelcast
- Ehcache
- Riak
- Aerospike
- Infinispan
- Cache2k
- Other distributed caching
- Amazon ElastiCache
- Oracle distributed cache (Coherence)
- Chapter 12: Microservice Basics
- Monolithic architecture and its drawbacks
- Introduction to microservices
- Independence and autonomy
- Resilience and fault tolerance
- Automated environment
- Benefits of microservices
- Microservice components
- Configuration server
- Load balancer
- Service discovery
- Circuit breaker
- Edge server
- Microservice tools
- Netflix Eureka
- Netflix Zuul
- Spring Cloud Netflix
- Netflix Ribbon
- Netflix Hystrix
- Netflix Turbine
- HashiCorp Consul
- Eclipse MicroProfile
- Chapter 13: Ticket Management - Advanced CRUD
- Ticket management using CRUD operations
- Registration
- User types
- User POJO
- Customer registration
- Admin registration
- CSR registration
- Login and token management
- Customer login
- Admin login
- CSR login
- Ticket management
- Ticket POJO
- Getting a user by token
- User Ticket management
- Ticket controller.
- The UserTokenRequired interface
- The UserTokenRequiredAspect class
- Getting my tickets - customer
- Allowing a user to view their single ticket
- Allowing a customer to update a ticket
- Updating a ticket - service (TicketServiceImpl)
- Deleting a ticket
- Deleting a service - service (TicketServiceImpl)
- Deleting my ticket - API (ticket controller)
- Admin Ticket management
- Allowing a admin to view all tickets
- Getting all tickets - service (TicketServiceImpl)
- Getting all tickets - API (ticket controller)
- The AdminTokenRequired interface
- The AdminTokenRequiredAspect class
- Admin updates a ticket
- Updating a ticket by admin - service (TicketServiceImpl)
- Allowing admin to view a single ticket
- Allowing admin to delete tickets
- Deleting tickets - service (TicketServiceImpl):
- Deleting tickets by admin - API (ticket controller):
- CSR Ticket management
- CSR updates a ticket
- CSRTokenRequired AOP
- CSRTokenRequiredAspect
- CSR view all tickets
- Viewing all tickets by CSR - API (ticket controller)
- CSR view single ticket
- CSR delete tickets
- Deleting tickets - service (TicketServivceImpl)
- Deleting tickets by CSR - API (ticket controller)
- Other Books You May Enjoy
- Index.
- Notes:
- Includes index.
- Description based on online resource; title from PDF title page (EBC, viewed February 23, 2018).
- ISBN:
- 9781788475891
- 1788475895
- 9781788471879
- 1788471873
- OCLC:
- 1022793177
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.