Spring Boot Cookbook
eBook - ePub

Spring Boot Cookbook

Alex Antonov

Partager le livre
  1. 206 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Spring Boot Cookbook

Alex Antonov

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Over 35 recipes to help you build, test, and run Spring applications using Spring Boot

About This Book

  • Learn to create different types of Spring Boot applications, configure behavior, and add custom components
  • Become more efficient in testing, deploying, and monitoring Spring Boot based applications
  • This is a practical guide that will help Spring developers to develop and deploy applications using Spring Boot

Who This Book Is For

If you are a Spring Developer who has good knowledge level and understanding of Spring Boot and application development and now want to learn efficient Spring Boot development techniques in order to make the existing development process more efficient, then this book is for you.

What You Will Learn

  • Create Spring Boot applications from scratch
  • Configure and tune web applications and containers
  • Create custom Spring Boot auto-configurations and starters
  • Use Spring Boot Test framework with JUnit, Cucumber, and Spock
  • Configure and tune web applications and containers
  • Deploy Spring Boot as self-starting executables and Docker containers
  • Monitor data using DropWizard, Graphite, and Dashing

In Detail

Spring Boot is Spring's convention-over-configuration solution. This feature makes it easy to create Spring applications and services with absolute minimum fuss. Spring Boot has the great ability to be customized and enhanced, and is specifically designed to simplify development of a new Spring application.

This book will provide many detailed insights about the inner workings of Spring Boot, as well as tips and recipes to integrate the third-party frameworks and components needed to build complex enterprise-scale applications.

The book starts with an overview of the important and useful Spring Boot starters that are included in the framework, and teaches you to create and add custom Servlet Filters, Interceptors, Converters, Formatters, and PropertyEditors to a Spring Boot web application. Next it will cover configuring custom routing rules and patterns, adding additional static asset paths, and adding and modifying servlet container connectors and other properties such as enabling SSL.

Moving on, the book will teach you how to create custom Spring Boot Starters, and explore different techniques to test Spring Boot applications. Next, the book will show you examples of configuring your build to produce Docker images and self-executing binary files for Linux/OSX environments.

Finally, the book will teach you how to create custom health indicators, and access monitoring data via HTTP and JMX.

Style and approach

This book is a cohesive collection of recipes that provide developers with a set of connected guidelines on how to build, configure, and customize their application, starting from the design and development stages, all the way through testing, deployment, and production monitoring.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Spring Boot Cookbook est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Spring Boot Cookbook par Alex Antonov en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatique et Programmation en Java. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2015
ISBN
9781785284151
Édition
1

Spring Boot Cookbook


Table of Contents

Spring Boot Cookbook
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Spring Boot
Introduction
Using a Spring Boot template and starters
How to do it

How it works

Creating a simple application
How to do it

How it works

Launching an application using Gradle
How to do it

How it works

Using the command-line runners
How to do it

How it works

Setting up a database connection
Getting ready
How to do it

How it works

Setting up a data repository service
How to do it

How it works

Scheduling executors
Getting ready
How to do it

How it works

2. Configuring Web Applications
Creating a basic RESTful application
How to do it

How it works

Creating a Spring Data REST service
How to do it

How it works

Configuring custom servlet filters
How to do it

How it works

Configuring custom interceptors
How to do it

How it works

Configuring custom HttpMessageConverters
How to do it

How it works

Configuring custom PropertyEditors
How to do it

How it works

Configuring custom type Formatters
How to do it

How it works

3. Web Framework Behavior Tuning
Introduction
Configuring route matching patterns
How to do it

How it works

Configuring custom static path mappings
How to do it

How it works

Tuning Tomcat via EmbeddedServletContainerCustomizer
How to do it

How it works

Choosing embedded servlet containers
How to do it

How it works

Adding custom connectors
Getting ready
How to do it

How it works

4. Writing Custom Spring Boot Starters
Introduction
Understanding Spring Boot autoconfiguration
How to do it

How it works

Creating a custom Spring Boot autoconfiguration starter
How to do it

How it works

Configuring custom conditional bean instantiations
How to do it

How it works

Using custom @Enable* annotations to toggle configurations
How to do it

How it works

5. Application Testing
Introduction
Creating tests for Spring MVC Controllers
How to do it

How it works

Automatically configuring the database schema and populating it with data
How to do it

How it works

Initializing the database with Spring JPA and Hibernate
Initializing the database with Spring JDBC
Creating tests using in-memory database with data fixtures
How to do it

How it works

Creating tests using Mockito to mock DB
How to do it

How it works

Writing tests using Cucumber
How to do it

How it works

Writing tests using Spock
How to do it

How it works

6. Application Packaging and Deployment
Introduction
Creating a Spring Boot executable JAR
How to do it

How it works

Creating Docker images
How to do it

How it works

Building self-executing binaries
Getting ready
How to do it

How it works

Spring Boot environment config hierarchy and precedence
How to do it

How it works

Externalizing environmental config using property files
How to do it

How it works

Externalizing environmental config using environment variables
How to do it

How it works

Externalizing environmental config using Java system properties
How to do it

How it works

Setting up Consul
How to do it

How it works

Externalizing environmental config using Consul and envconsul
Getting ready
How to do it

How it works

7. Health Monitoring and Data Visualization
Introduction
Writing custom health indicators
How to do it

How it works

Emitting metrics
Getting ready
How to do it

How it works

Monitoring Spring Boot via JMX
Getting ready
How to do it

How it works

Management of Spring Boot via CRaSH and writing custom remote shell commands
How to do it

How it works

Integrating Codahale/Dropwizard metrics with Graphite
Getting ready
How to do it

How it works

Integrating Codahale/Dropwizard metrics with Dashing
Getting ready
How to do it

How it works

Index

Spring Boot Cookbook

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2015
Production reference: 1240915
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-415-1
www.packtpub.com

Credits

Author
Alex Antonov
Reviewers
Theo Pack
Eric Pirard
Geoffroy Warin
Ricky Yim
Commissioning Editor
Dipali Goankar
Acquisition Editor
Sonali Vernekar
Content Development Editor
Shweta Pant
Technical Editor
Bharat Patil
Copy Editor
Tasneem Fatehi
Project Coordinator
Shipra Chawhan
Proofreader
Safis Editing
Indexer
Monica Ajmera Mehta
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta

About the Author

Alex Antonov is a very passionate technologist with a hunger to learn new tools, languages, techniques, and concepts behind enterprise application design. His specialty lies in designing highly scalable distributed large-scale enterprise systems, which he has been successfully doing for the last 12 years. He is also a frequent presenter on the topics of architecture and design at conferences such as UberConf, JavaOne, and Spring 2GX.
Alex joined Orbitz Worldwide in 2004, and in his current role of Senior Principal Engineer, he is responsible for providing technical leadership and guidance in the development of foundational technologies, core libraries, and APIs for enterprise-wide use, as well as establishing and maintaining common design principles and standards used within the company and integration of new software development practices within the development community. He has extensive experience in enterprise architecture designing distributed systems, and spends a lot of time doing object domain modeling and focusing on domain-driven design and behavior-driven development and testing. Prior to that, Alex was a lead engineer in the same team that was responsible for web application frameworks and developing common practices and additional functionality on top of Spring MVC and Webflow.
He has ...

Table des matiĂšres