Spring Microservices In Action 1st Edition John Carnell
Spring Microservices In Action 1st Edition John Carnell
Spring Microservices In Action 1st Edition John Carnell
Spring Microservices In Action 1st Edition John Carnell
1. Spring Microservices In Action 1st Edition John
Carnell download
https://ebookbell.com/product/spring-microservices-in-action-1st-
edition-john-carnell-7015316
Explore and download more ebooks at ebookbell.com
2. Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Spring Microservices In Action Second Edition Meap V06 2nd Edition
John Carnell
https://ebookbell.com/product/spring-microservices-in-action-second-
edition-meap-v06-2nd-edition-john-carnell-24413182
Spring Microservices In Action Second Edition Meap V08 2nd Edition
John Carnell
https://ebookbell.com/product/spring-microservices-in-action-second-
edition-meap-v08-2nd-edition-john-carnell-25295904
Spring Microservices In Action 1st Edition John Carnell
https://ebookbell.com/product/spring-microservices-in-action-1st-
edition-john-carnell-55587648
Pro Spring Boot 3 With Kotlin Indepth Guide To Best Practices For
Cloudnative And Microservices Development 3rd Edition Peter Spth
https://ebookbell.com/product/pro-spring-boot-3-with-kotlin-indepth-
guide-to-best-practices-for-cloudnative-and-microservices-
development-3rd-edition-peter-spth-231835744
3. Pro Spring Boot 3 With Kotlin Indepth Guide To Best Practices For
Cloudnative And Microservices Development 3rd Edition Peter Spth
https://ebookbell.com/product/pro-spring-boot-3-with-kotlin-indepth-
guide-to-best-practices-for-cloudnative-and-microservices-
development-3rd-edition-peter-spth-231835754
Spring Microservices With Spring Boot Build And Deploy Microservices
With Spring Boot Ranga Rao Karanam
https://ebookbell.com/product/spring-microservices-with-spring-boot-
build-and-deploy-microservices-with-spring-boot-ranga-rao-
karanam-54521122
Spring Microservices Rajesh Rv
https://ebookbell.com/product/spring-microservices-rajesh-rv-6808994
Spring Microservices With Spring Boot Ranga Rao Karanam
https://ebookbell.com/product/spring-microservices-with-spring-boot-
ranga-rao-karanam-48805996
Spring Boot Microservices On Aws Elastic Kubernetes Services Eks With
Awd Rds Backend Binit Datta Datta
https://ebookbell.com/product/spring-boot-microservices-on-aws-
elastic-kubernetes-services-eks-with-awd-rds-backend-binit-datta-
datta-27068966
10. To my brother Jason, who even in his darkest moments
showed me the true meaning of strength and dignity.
You are a role model as a brother, husband, and father.
Licensed to <null>
12. vii
brief contents
1 ■ Welcome to the cloud, Spring 1
2 ■ Building microservices with Spring Boot 35
3 ■ Controlling your configuration with Spring Cloud
configuration server 64
4 ■ On service discovery 96
5 ■ When bad things happen: client resiliency patterns with
Spring Cloud and Netflix Hystrix 119
6 ■ Service routing with Spring Cloud and Zuul 153
7 ■ Securing your microservices 192
8 ■ Event-driven architecture with Spring Cloud Stream 228
9 ■ Distributed tracing with Spring Cloud Sleuth and Zipkin 259
10 ■ Deploying your microservices 288
Licensed to <null>
14. ix
contents
preface xv
acknowledgments xvii
about this book xix
about the author xxii
about the cover illustration xxiii
1 Welcome to the cloud, Spring 1
1.1 What’s a microservice? 2
1.2 What is Spring and why is it relevant to microservices? 5
1.3 What you’ll learn in this book 6
1.4 Why is this book relevant to you? 7
1.5 Building a microservice with Spring Boot 8
1.6 Why change the way we build applications? 12
1.7 What exactly is the cloud? 13
1.8 Why the cloud and microservices? 15
1.9 Microservices are more than writing the code 17
Core microservice development pattern 19 ■
Microservice routing
patterns 20 ■
Microservice client resiliency patterns 21
Microservice security patterns 23 ■
Microservice logging and
tracing patterns 24 ■
Microservice build/deployment patterns 25
1.10 Using Spring Cloud in building your microservices 26
Spring Boot 28 ■
Spring Cloud Config 28 ■
Spring Cloud
service discovery 28 ■
Spring Cloud/Netflix Hystrix and
Licensed to <null>
15. CONTENTS
x
Ribbon 29 ■
Spring Cloud/Netflix Zuul 29 ■
Spring Cloud
Stream 29 ■
Spring Cloud Sleuth 29 ■
Spring Cloud
Security 30 ■
What about provisioning? 30
1.11 Spring Cloud by example 30
1.12 Making sure our examples are relevant 33
1.13 Summary 33
2 Building microservices with Spring Boot 35
2.1 The architect’s story: designing the microservice
architecture 38
Decomposing the business problem 38 ■
Establishing service
granularity 41 ■
Talking to one another: service interfaces 43
2.2 When not to use microservices 44
Complexity of building distributed systems 44 ■
Server
sprawl 44 ■
Type of application 44 ■
Data transformations
and consistency 45
2.3 The developer’s tale: building a microservice with Spring
Boot and Java 45
Getting started with the skeleton project 46 ■
Booting your Spring
Boot application: writing the Bootstrap class 47 ■
Building the
doorway into the microservice: the Spring Boot controller 48
2.4 The DevOps story: building for the rigors of runtime 53
Service assembly: packaging and deploying your microservices 56
Service bootstrapping: managing configuration of your
microservices 58 ■
Service registration and discovery: how clients
communicate with your microservices 59 ■
Communicating a
microservice’s health 60
2.5 Pulling the perspectives together 62
2.6 Summary 63
3 Controlling your configuration with Spring Cloud
configuration server 64
3.1 On managing configuration (and complexity) 65
Your configuration management
architecture 67 ■
Implementation choices 69
3.2 Building our Spring Cloud configuration server 70
Setting up the Spring Cloud Config Bootstrap class 74
Using Spring Cloud configuration server with the filesystem 75
Licensed to <null>
16. CONTENTS xi
3.3 Integrating Spring Cloud Config with a Spring Boot client 77
Setting up the licensing service Spring Cloud Config server
dependencies 79 ■
Configuring the licensing service to use Spring
Cloud Config 79 ■
Wiring in a data source using Spring Cloud
configuration server 83 ■
Directly Reading Properties using the
@Value Annotation 86 ■
Using Spring Cloud configuration
server with Git 87 ■
Refreshing your properties using Spring Cloud
configuration server 88
3.4 Protecting sensitive configuration information 89
Download and install Oracle JCE jars needed for encryption 90
Setting up an encryption key 91 ■
Encrypting and decrypting a
property 91 ■
Configure microservices to use encryption on the
client side 93
3.5 Closing thoughts 95
3.6 Summary 95
4 On service discovery 96
4.1 Where’s my service? 97
4.2 On service discovery in the cloud 100
The architecture of service discovery 100 ■
Service discovery in
action using Spring and Netflix Eureka 103
4.3 Building your Spring Eureka Service 105
4.4 Registering services with Spring Eureka 107
4.5 Using service discovery to look up a service 111
Looking up service instances with Spring DiscoveryClient 112
Invoking services with Ribbon-aware Spring RestTemplate 114
Invoking services with Netflix Feign client 116
4.6 Summary 118
5 When bad things happen: client resiliency patterns with
Spring Cloud and Netflix Hystrix 119
5.1 What are client-side resiliency patterns? 120
Client-side load balancing 121 ■
Circuit breaker 122
Fallback processing 122 ■
Bulkheads 122
5.2 Why client resiliency matters 123
5.3 Enter Hystrix 126
5.4 Setting up the licensing server to use Spring Cloud and
Hystrix 127
Licensed to <null>
17. CONTENTS
xii
5.5 Implementing a circuit breaker using Hystrix 128
Timing out a call to the organization microservice 131
Customizing the timeout on a circuit breaker 132
5.6 Fallback processing 133
5.7 Implementing the bulkhead pattern 136
5.8 Getting beyond the basics; fine-tuning Hystrix 138
Hystrix configuration revisited 142
5.9 Thread context and Hystrix 144
ThreadLocal and Hystrix 144 ■
The HystrixConcurrencyStrategy
in action 147
5.10 Summary 151
6 Service routing with Spring Cloud and Zuul 153
6.1 What is a services gateway? 154
6.2 Introducing Spring Cloud and Netflix Zuul 157
Setting up the Zuul Spring Boot project 157 ■
Using Spring
Cloud annotation for the Zuul service 157 ■
Configuring Zuul
to communicate with Eureka 158
6.3 Configuring routes in Zuul 159
Automated mapping routes via service discovery 159
Mapping routes manually using service discovery 161
Manual mapping of routes using static URLs 165
Dynamically reload route configuration 168 ■
Zuul and
service timeouts 169
6.4 The real power of Zuul: filters 169
6.5 Building your first Zuul pre-filter generating correlation
IDs 173
Using the correlation ID in your service calls 176
6.6 Building a post filter receiving correlation IDs 182
6.7 Building a dynamic route filter 184
Building the skeleton of the routing filter 186 ■
Implementing the
run() method 187 ■
Forwarding the route 188 ■
Pulling it all
together 190
6.8 Summary 191
7 Securing your microservices 192
7.1 Introduction to OAuth2 193
Licensed to <null>
18. CONTENTS xiii
7.2 Starting small: using Spring and OAuth2 to protect a
single endpoint 195
Setting up the EagleEye OAuth2 authentication service 196
Registering client applications with the OAuth2 service 197
Configuring EagleEye users 200 ■
Authenticating the user 202
7.3 Protecting the organization service using OAuth2 205
Adding the Spring Security and OAuth2 jars to the individual
services 205 ■
Configuring the service to point to your OAuth2
authentication service 206 ■
Defining who and what can access
the service 207 ■
Propagating the OAuth2 access token 210
7.4 JavaScript Web Tokens and OAuth2 213
Modifying the authentication service to issue JavaScript Web
Tokens 214 ■
Consuming JavaScript Web Tokens in your
microservices 218 ■
Extending the JWT Token 220
Parsing a custom field out of a JavaScript token 222
7.5 Some closing thoughts on microservice security 224
7.6 Summary 227
8 Event-driven architecture with Spring Cloud Stream 228
8.1 The case for messaging, EDA, and microservices 229
Using synchronous request-response approach to communicate state
change 230 ■
Using messaging to communicate state changes between
services 233 ■
Downsides of a messaging architecture 235
8.2 Introducing Spring Cloud Stream 236
The Spring Cloud Stream architecture 237
8.3 Writing a simple message producer and consumer 238
Writing the message producer in the organization service 239
Writing the message consumer in the licensing service 244
Seeing the message service in action 247
8.4 A Spring Cloud Stream use case: distributed caching 249
Using Redis to cache lookups 250 ■
Defining custom channels 256
Bringing it all together: clearing the cache when a message is received 257
8.5 Summary 258
9 Distributed tracing with Spring Cloud Sleuth and Zipkin 259
9.1 Spring Cloud Sleuth and the correlation ID 260
Adding Spring Cloud sleuth to licensing and organization 261
Anatomy of a Spring Cloud Sleuth trace 262
Licensed to <null>
19. CONTENTS
xiv
9.2 Log aggregation and Spring Cloud Sleuth 263
A Spring Cloud Sleuth/Papertrail implementation in action 265
Create a Papertrail account and configure a syslog connector 267
Redirecting Docker output to Papertrail 268 ■
Searching for
Spring Cloud Sleuth trace IDs in Papertrail 270 ■
Adding the
correlation ID to the HTTP response with Zuul 272
9.3 Distributed tracing with Open Zipkin 274
Setting up the Spring Cloud Sleuth and Zipkin dependencies 275
Configuring the services to point to Zipkin 275 ■
Installing and
configuring a Zipkin server 276 ■
Setting tracing levels 278
Using Zipkin to trace transactions 278 ■
Visualizing a more
complex transaction 281 ■
Capturing messaging traces 282
Adding custom spans 284
9.4 Summary 287
10 Deploying your microservices 288
10.1 EagleEye: setting up your core infrastructure in the cloud 290
Creating the PostgreSQL database using Amazon RDS 293
Creating the Redis cluster in Amazon 296 ■
Creating an ECS
cluster 298
10.2 Beyond the infrastructure: deploying EagleEye 302
Deploying the EagleEye services to ECS manually 303
10.3 The architecture of a build/deployment pipeline 305
10.4 Your build and deployment pipeline in action 309
10.5 Beginning your build deploy/pipeline: GitHub and Travis
CI 311
10.6 Enabling your service to build in Travis CI 312
Core build run-time configuration 315 ■
Pre-build tool
installations 318 ■
Executing the build 320 ■
Tagging the
source control code 320 ■
Building the microservices and creating
the Docker images 321 ■
Pushing the images to Docker Hub 322
Starting the services in Amazon ECS 323 ■
Kicking off the
platform tests 323
10.7 Closing thoughts on the build/deployment pipeline 325
10.8 Summary 325
appendix A Running a cloud on your desktop 327
appendix B OAuth2 grant types 336
index 345
Licensed to <null>
20. xv
preface
It’s ironic that in writing a book, the last part of the book you write is often the begin-
ning of the book. It’s also often the most difficult part to put down on paper. Why?
Because you have to explain to everyone why you’re so passionate about a subject that
you spent the last one and a half years of your life writing a book about it. It’s hard to
articulate why anyone would spend such a large amount of time on a technical book.
One rarely writes software books for the money or the fame.
Here’s the reason why I wrote this book: I love writing code. It’s a calling for me
and it’s also a creative activity—akin to drawing, painting, or playing an instrument.
Those outside the field of software development have a hard time understanding this.
I especially like building distributed applications. For me, it’s an amazing thing to see
an application work across dozens (even hundreds) of servers. It’s like watching an
orchestra playing a piece of music. While the final product of an orchestra is beauti-
ful, the making of it is often a lot of hard work and requires a significant amount of
practice. The same goes for writing a massively distributed application.
Since I entered the software development field 25 years ago, I’ve watched the
industry struggle with the “right” way to build distributed applications. I’ve seen dis-
tributed service standards such as CORBA rise and fall. Monstrously big companies
have tried to push big and, often, proprietary protocols. Anyone remember Micro-
soft’s Distributed Component Object Model (DCOM) or Oracle’s J2EE’s Enterprise
Java Beans 2 (EJB)? I watched as technology companies and their followers rushed to
build service-oriented architectures (SOA) using heavy XML-based schemas.
In each case, these approaches for building distributed systems often collapsed
under their own weight. I’m not saying that these technologies weren’t used to build
some very powerful applications. The reality is that they couldn’t keep up with the
Licensed to <null>
21. PREFACE
xvi
demand of the users. Ten years ago, smartphones were just being introduced to the
market and cloud computing was in the earliest stage of infancy. Also, the standards
and technology for distributed application development were too complicated for the
average developer to understand and easily use in practice. Nothing speaks truth in
the software development industry like written code. When the standards get in the
way of this, the standards quickly get discarded.
When I first heard of the microservices approach to building applications I was
more than a little skeptical. “Great, another silver-bullet approach to building distrib-
uted applications,” I thought. However, as I started diving into the concepts, I realized
the simplicity of microservices could be a game changer. A microservice architecture
focuses on building small services that use simple protocols (HTTP and JSON) to com-
municate. That’s it. You can write a microservice with nearly any programming lan-
guage. There’s beauty in this simplicity.
However, while building an individual microservice is easy, operationalizing and
scaling it is difficult. Getting hundreds of small distributed components to work
together and then building a resilient application from them can be incredibly diffi-
cult to do. In distributed computing, failure is a fact of life and how your application
deals with it is incredibly difficult to get right. To paraphrase my colleagues Chris
Miller and Shawn Hagwood: “If it’s not breaking once in a while, you’re not building.”
It’s these failures that inspired me to write this book. I hate to build things from
scratch when I don’t have to. The reality is that Java is the lingua franca for most appli-
cation development efforts, especially in the enterprise. The Spring framework has for
many organizations become the de facto framework for most application develop-
ment. I’d already been doing application development in Java for almost 20 years (I
remember the Dancing Duke applet) and Spring for almost 10 years. As I began my
microservices journey, I was delighted and excited to watch the emergence of Spring
Cloud.
The Spring Cloud framework provides out-of-the-box solutions for many of the
common development and operational problems you’ll run into as a microservice
developer. Spring Cloud lets you use only the pieces you need and minimizes the
amount of work you need to do to build and deploy production-ready Java micro-
services. It does this by using other battle-hardened technologies from companies and
groups such as Netflix, HashiCorp, and the Apache foundation.
I’ve always considered myself an average developer who, at the end of the day, has
deadlines to meet. That’s why I undertook the project of writing this book. I wanted a
book that I could use in my day-to-day work. I wanted something with direct (and
hopefully) straightforward code examples. I always want to make sure that the mate-
rial in this book can be consumed as individual chapters or in its entirety. I hope you
find this book useful and I hope you enjoy reading it as much as I enjoyed writing it.
Licensed to <null>
22. xvii
acknowledgments
As I sit down to write these acknowledgments, I can’t help but think back to 2014
when I ran my first marathon. Writing a book is a lot like running a marathon. Writing
the proposal and the outline for the book is much like the training process. It gets
your thoughts in shape, it focuses you for what’s ahead and, yes, near the end of the
process, it can be more than a little tedious and brutal.
When you start writing the book, it’s a lot like race day. You start the marathon
excited and full of energy. You know you’re trying to do something bigger than any-
thing you might have done before and it’s both exciting and nerve-wracking. This is
what you’ve trained for, but at the same time, there’s always that small voice of doubt
in the back of your mind that says you won’t finish what you started.
What I’ve learned from running is that races aren’t completed one mile at a time.
Instead, they’re run one foot in front of the other. The miles run are the sum of the
individual footsteps. When my children are struggling with something, I laugh and ask
them, “How do you write a book? One word, one single step at a time.” They usually
roll their eyes, but in the end there’s no other way around this indisputable and iron-
clad law.
However, when you run a marathon, you might be the one running the race, but
you’re never running it alone. There’s a whole team of people there to give you sup-
port, time, and advice along the way. It has been the same experience writing this
book.
I’d like to start by thanking Manning for the support they gave me in writing this
book. It started with Greg Wild, my acquisitions editor, who patiently worked with me
as I refined the core concepts in this book and guided me through the proposal pro-
cess. Along the way, Marina Michaels, my development editor, kept me honest and
Licensed to <null>
23. ACKNOWLEDGMENTS
xviii
challenged me to become a better author. I’d also like to thank Raphael Villela and
Joshua White, my technical editors, who constantly checked my work and ensured the
overall quality of the examples and the code I produced. I’m extremely grateful for
the time, talent, and commitment each of these individuals put into into the overall
project. I’d also like to thank the reviewers who provided feedback on the manuscript
throughout the writing and development process: Aditya Kumar, Adrian M. Rossi,
Ashwin Raj, Christian Bach, Edgar Knapp, Jared Duncan, Jiri Pik, John Guthrie, Mirko
Bernardoni, Paul Balogh, Pierluigi Riti, Raju Myadam, Rambabu Posa, Sergey Evsikov,
and Vipul Gupta.
I want to close these acknowledgments with a deep sense of thanks for the love and
time my family has given me in working on this project. To my wife Janet, you have
been my best friend and the love of my life. When I’m tired and want to give up, I only
have to listen for the sound of your footsteps next to me to know that you’re always
running beside me, never telling me no, and always pushing me forward.
To my son Christopher, you’re growing up to be an incredible young man. I can-
not wait for the day when you truly discover your passion, because there will be noth-
ing in this world that can stop you from reaching your goals.
To my daughter Agatha, I’d give all the money I have to see the world through
your eyes for just 10 minutes. The experience would make me a better author and
more importantly a better person. Your intellect, your power of observation, and cre-
ativity humble me.
To my four-year-old son, Jack: Buddy, thank you being patient with me whenever I
said, “I can’t play right now because Daddy has to work on the book.” You always make
me laugh and you make this whole family complete. Nothing makes me happier than
when I see you being the jokester and playing with everyone in the family.
My race with this book is done. Like my marathon, I’ve left nothing on the table in
writing this book. I have nothing but gratitude for the Manning team and the MEAP
readers who bought this book early and gave me so much valuable feedback. I hope in
the end that you enjoy this book as much as I enjoyed writing it. Thank you.
Licensed to <null>
24. xix
about this book
Spring Microservices in Action was written for the practicing Java/Spring developer who
needs hands-on advice and examples of how to build and operationalize microservice-
based applications. When I wrote this book, I wanted it to be based around core
microservice patterns that aligned with Spring Boot and Spring Cloud examples that
demonstrated the patterns in action. As such, you’ll find specific microservice design
patterns discussed in almost every chapter, along with examples of the patterns imple-
mented using Spring Boot and Spring Cloud.
You should read this book if
You’re a Java developer who has experience building distributed applications
(1-3 years).
You have a background in Spring (1+ years).
You’re interested in learning how to build microservice-based applications.
You’re interested in how you can use microservices for building cloud-based
applications.
You want to know if Java and Spring are relevant technologies for building
microservice-based applications.
You’re interested in seeing what goes into deploying a microservice-based appli-
cation to the cloud.
How this book is organized
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.
Licensed to <null>
25. ABOUT THIS BOOK
xx
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.
Licensed to <null>
26. ABOUT THIS BOOK xxi
About the code
Spring Microservices in Action includes code in every chapter. All code examples are avail-
able in my GitHub repository, and each chapter has its own repository. You can find an
overview page with links to each chapter’s code repository at https:/
/github.com/
carnellj/spmia_overview. A zip containing all source code is also available from the
publisher’s website at www.manning.com/books/spring-microservices-in-action.
All code in this book is built to run on Java 8 using Maven as the main build tool.
Please refer to appendix A of this book for full details on the software tools you’ll
need to compile and run the code examples.
One of the core concepts I followed as I wrote this book was that the code exam-
ples in each chapter should run independently of those in the other chapters. As
such, every service we create for a chapter builds to a corresponding Docker image.
When code from previous chapters is used, it’s included as both source and a built
Docker image. We use Docker compose and the built Docker images to guarantee
that you have a reproducible run-time environment for every chapter.
This book contains many examples of source code both in numbered listings and
in line with normal text. In both cases, source code is formatted in a fixed-width
font like this to separate it from ordinary text. Sometimes code is also in bold to
highlight code that has changed from previous steps in the chapter, such as when a
new feature adds to an existing line of code.
In many cases, the original source code has been reformatted; we’ve added line
breaks and reworked indentation to accommodate the available page space in the
book. In rare cases, even this wasn’t enough, and listings include line-continuation
markers (➥). Additionally, comments in the source code have often been removed
from the listings when the code is described in the text. Code annotations accompany
many of the listings, highlighting important concepts.
Author Online
Purchase of Spring Microservices in Action includes free access to a private web forum
run by Manning Publications where you can make comments about the book, ask
technical questions, and receive help from the author and from other users. To access
the forum and subscribe to it, point your web browser to www.manning.com/books
/spring-microservices-in-action. This page provides information on how to get on the
forum once you’re registered, what kind of help is available, and the rules of conduct
on the forum.
Manning’s commitment to our readers is to provide a venue where a meaningful
dialog between individual readers and between readers and the author can take place.
It is not a commitment to any specific amount of participation on the part of the
author, whose contributions to the AO remain voluntary (and unpaid). We suggest
you ask the author challenging questions, lest his interest stray!
Licensed to <null>
27. xxii
about the author
JOHN CARNELL is a senior cloud engineer at Genesys, where he
works in Genesys’s PureCloud division. John spends the major-
ity of his day hands-on building telephony-based microservices
using the AWS platform. His day-to-day job centers on designing
and building microservices across a number of technology plat-
forms including Java, Clojure, and Go.
John is a prolific speaker and writer. He regularly speaks at
local user groups and has been a regular speaker on “The No
Fluff Just Stuff Software Symposium.” Over the last 20 years, John has authored, co-
authored, and been a technical reviewer for a number of Java-based technology books
and industry publications.
John holds a Bachelor of the Arts (BA) from Marquette University and a Masters of
Business Administration (MBA) from the University of Wisconsin Oshkosh.
John is a passionate technologist and is constantly exploring new technologies and
programming languages. When John isn’t speaking, writing, or coding, he lives with
his wife Janet, his three children, Christopher, Agatha, and Jack, and yes, his dog
Vader, in Cary, North Carolina.
During his free time (which there’s very little of) John runs, chases after his chil-
dren, and studies Filipino martial arts.
John can be reached at john_carnell@yahoo.com.
Licensed to <null>
28. xxiii
about the cover illustration
The figure on the cover of Spring Microservices in Action is captioned a “A Man from
Croatia.” This illustration is taken from a recent reprint of Balthasar Hacquet’s Images
and Descriptions of Southwestern and Eastern Wenda, Illyrians, and Slavs, published by the
Ethnographic Museum in Split, Croatia, in 2008. Hacquet (1739–1815) was an Aus-
trian physician and scientist who spent many years studying the botany, geology, and
ethnography of many parts of the Austrian Empire, as well as the Veneto, the Julian
Alps, and the western Balkans, inhabited in the past by peoples of the Illyrian tribes.
Hand drawn illustrations accompany the many scientific papers and books that Hac-
quet published.
The rich diversity of the drawings in Hacquet's publications speaks vividly of the
uniqueness and individuality of the eastern Alpine and northwestern Balkan regions
just 200 years ago. This was a time when the dress codes of two villages separated by a
few miles identified people uniquely as belonging to one or the other, and when
members of a social class or trade could be easily distinguished by what they were
wearing. Dress codes have changed since then and the diversity by region, so rich at
the time, has faded away. It is now often hard to tell the inhabitant of one continent
from another, and today the inhabitants of the picturesque towns and villages in the
Slovenian Alps or Balkan coastal towns are not readily distinguishable from the resi-
dents of other parts of Europe.
We at Manning celebrate the inventiveness, the initiative, and the fun of the com-
puter business with book covers based on costumes from two centuries ago, brought
back to life by illustrations such as this one.
Licensed to <null>
30. 1
Welcome to the cloud,
Spring
The one constant in the field of software development is that we as software devel-
opers sit in the middle of a sea of chaos and change. We all feel the churn as new
technologies and approaches appear suddenly on the scene, causing us to reevalu-
ate how we build and deliver solutions for our customers. One example of this
churn is the rapid adoption by many organizations of building applications using
This chapter covers
Understanding microservices and why companies
use them
Using Spring, Spring Boot, and Spring Cloud for
building microservices
Learning why the cloud and microservices are relevant
to microservice-based applications
Building microservices involves more than building
service code
Understanding the parts of cloud-based development
Using Spring Boot and Spring Cloud in microservice
development
Licensed to <null>
31. 2 CHAPTER 1 Welcome to the cloud, Spring
microservices. Microservices are distributed, loosely coupled software services that
carry out a small number of well-defined tasks.
This book introduces you to the microservice architecture and why you should
consider building your applications with them. We’re going to look at how to build
microservices using Java and two Spring framework projects: Spring Boot and Spring
Cloud. If you’re a Java developer, Spring Boot and Spring Cloud will provide an easy
migration path from building traditional, monolithic Spring applications to microser-
vice applications that can be deployed to the cloud.
1.1 What’s a microservice?
Before the concept of microservices evolved, most web-based applications were built
using a monolithic architectural style. In a monolithic architecture, an application is
delivered as a single deployable software artifact. All the UI (user interface), business,
and database access logic are packaged together into a single application artifact and
deployed to an application server.
While an application might be a deployed as a single unit of work, most of the time
there will be multiple development teams working on the application. Each develop-
ment team will have their own discrete pieces of the application they’re responsible
for and oftentimes specific customers they’re serving with their functional piece. For
example, when I worked at a large financial services company, we had an in-house,
custom-built customer relations management (CRM) application that involved the
coordination of multiple teams including the UI, the customer master, the data ware-
house, and the mutual funds team. Figure 1.1 illustrates the basic architecture of this
application.
The problem here is that as the size and complexity of the monolithic CRM appli-
cation grew, the communication and coordination costs of the individual teams work-
ing on the application didn’t scale. Every time an individual team needed to make a
change, the entire application had to be rebuilt, retested and redeployed.
The concept of a microservice originally crept into the software development com-
munity’s consciousness around 2014 and was a direct response to many of the chal-
lenges of trying to scale both technically and organizationally large, monolithic
applications. Remember, a microservice is a small, loosely coupled, distributed service.
Microservices allow you to take a large application and decompose it into easy-to-
manage components with narrowly defined responsibilities. Microservices help combat
the traditional problems of complexity in a large code base by decomposing the large
code base down into small, well-defined pieces. The key concept you need to embrace
as you think about microservices is decomposing and unbundling the functionality of
Licensed to <null>
32. 3
What’s a microservice?
Each team has their own areas
of responsibity with their own
requirements and delivery demands.
All their work is synchronized
into a single code base.
The entire application also has knowledge of
and access to all of the data sources used
within the application.
Mutual funds
database
Single source code
repository
Mutual funds team
Customer master
team
Data warehousing
team
UI team
Java application server
(JBoss, Websphere, WebLogic, Tomcat)
Typical
Spring-based
web applications
Customer master
database
Data
warehouse
MVC
WAR
Spring
services
Spring data
Continuous
integration
pipeline
Figure 1.1 Monolithic applications force multiple development teams to artificially synchronize their delivery
because their code needs to be built, tested, and deployed as an entire unit.
Licensed to <null>
33. 4 CHAPTER 1 Welcome to the cloud, Spring
your applications so they’re completely independent of one another. If we take the
CRM application we saw in figure 1.1 and decompose it into microservices, it might
look like what’s shown in figure 1.2.
Looking at figure 1.2, you can see that each functional team completely owns their
service code and service infrastructure. They can build, deploy, and test indepen-
dently of each other because their code, source control repository, and the infrastruc-
ture (app server and database) are now completely independent of the other parts of
the application.
Invokes all business
logic as REST-based
service calls
Mutual funds
source code repository
Mutual funds team
Customer master
team
Data warehousing
team
UI team
Mutual funds
database
Mutual funds
microservice
Continuous
integration
pipeline
Customer master
source code repository
Customer
master
database
Customer
master
microservice
Continuous
integration
pipeline
Data warehouse
source code repository
Data
warehouse
Data
warehouse
microservice
Continuous
integration
pipeline
UI source code
repository
UI web
application
Continuous
integration
pipeline
Figure 1.2 Using a microservice architecture our CRM application would be decomposed into a set
of microservices completely independent of each other, allowing each development team to move at
their own pace.
Licensed to <null>
34. 5
What is Spring and why is it relevant to microservices?
A microservice architecture has the following characteristics:
Application logic is broken down into small-grained components with well-
defined boundaries of responsibility that coordinate to deliver a solution.
Each component has a small domain of responsibility and is deployed com-
pletely independently of one another. Microservices should have responsibility
for a single part of a business domain. Also, a microservice should be reusable
across multiple applications.
Microservices communicate based on a few basic principles (notice I said prin-
ciples, not standards) and employ lightweight communication protocols such as
HTTP and JSON (JavaScript Object Notation) for exchanging data between the
service consumer and service provider.
The underlying technical implementation of the service is irrelevant because
the applications always communicate with a technology-neutral protocol (JSON
is the most common). This means an application built using a microservice
application could be built with multiple languages and technologies.
Microservices—by their small, independent, and distributed nature—allow
organizations to have small development teams with well-defined areas of
responsibility. These teams might work toward a single goal such as delivering
an application, but each team is responsible only for the services on which
they’re working.
I often joke with my colleagues that microservices are the gateway drug for building
cloud applications. You start building microservices because they give you a high
degree of flexibility and autonomy with your development teams, but you and your
team quickly find that the small, independent nature of microservices makes them
easily deployable to the cloud. Once the services are in the cloud, their small size
makes it easy to start up large numbers of instances of the same service, and suddenly
your applications become more scalable and, with forethought, more resilient.
1.2 What is Spring and why is it relevant to microservices?
Spring has become the de facto development framework for building Java-based appli-
cations. At its core, Spring is based on the concept of dependency injection. In a nor-
mal Java application, the application is decomposed into classes where each class
often has explicit linkages to other classes in the application. The linkages are the
invocation of a class constructor directly in the code. Once the code is compiled,
these linkage points can’t be changed.
This is problematic in a large project because these external linkages are brittle and
making a change can result in multiple downstream impacts to other code. A depen-
dency injection framework, such as Spring, allows you to more easily manage large Java
projects by externalizing the relationship between objects within your application
through convention (and annotations) rather than those objects having hard-coded
knowledge about each other. Spring sits as an intermediary between the different Java
Licensed to <null>
35. 6 CHAPTER 1 Welcome to the cloud, Spring
classes of your application and manages their dependencies. Spring essentially lets you
assemble your code together like a set of Lego bricks that snap together.
Spring’s rapid inclusion of features drove its utility, and the framework quickly
became a lighter weight alternative for enterprise application Java developers looking
for a way to building applications using the J2EE stack. The J2EE stack, while powerful,
was considered by many to be bloatware, with many features that were never used by
application development teams. Further, a J2EE application forced you to use a full-
blown (and heavy) Java application server to deploy your applications.
What’s amazing about the Spring framework and a testament to its development
community is its ability to stay relevant and reinvent itself. The Spring development
team quickly saw that many development teams were moving away from monolithic
applications where the application’s presentation, business, and data access logic were
packaged together and deployed as a single artifact. Instead, teams were moving to
highly distributed models where services were being built as small, distributed services
that could be easily deployed to the cloud. In response to this shift, the Spring devel-
opment team launched two projects: Spring Boot and Spring Cloud.
Spring Boot is a re-envisioning of the Spring framework. While it embraces core
features of Spring, Spring Boot strips away many of the “enterprise” features found in
Spring and instead delivers a framework geared toward Java-based, REST-oriented
(Representational State Transfer)1
microservices. With a few simple annotations, a
Java developer can quickly build a REST microservice that can be packaged and
deployed without the need for an external application container.
NOTE While we cover REST in more detail in chapter 2, the core concept
behind REST is that your services should embrace the use of the HTTP verbs
(GET, POST, PUT, and DELETE) to represent the core actions of the service
and use a lightweight web-oriented data serialization protocol, such as JSON,
for requesting and receiving data from the service.
Because microservices have become one of the more common architectural patterns
for building cloud-based applications, the Spring development community has given
us Spring Cloud. The Spring Cloud framework makes it simple to operationalize and
deploy microservices to a private or public cloud. Spring Cloud wraps several popular
cloud-management microservice frameworks under a common framework and makes
the use and deployment of these technologies as easy to use as annotating your code. I
cover the different components within Spring Cloud later in this chapter.
1.3 What you’ll learn in this book
This book is about building microservice-based applications using Spring Boot and
Spring Cloud that can be deployed to a private cloud run by your company or a public
1
While we cover REST later in chapter 2, it’s worthwhile to read Roy Fielding’s PHD dissertation on building
REST-based applications (http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm). It’s still one of the
best explanations of REST available.
Licensed to <null>
36. 7
Why is this book relevant to you?
cloud such as Amazon, Google, or Pivotal. With this book, we cover with hands-on
examples
What a microservice is and the design considerations that go into building a
microservice-based application
When you shouldn’t build a microservice-based application
How to build microservices using the Spring Boot framework
The core operational patterns that need to be in place to support microservice
applications, particularly a cloud-based application
How you can use Spring Cloud to implement these operational patterns
How to take what you’ve learned and build a deployment pipeline that can be
used to deploy your services to a private, internally managed cloud or a public
cloud provider
By the time you’re done reading this book, you should have the knowledge needed to
build and deploy a Spring Boot-based microservice. You’ll also understand the key
design decisions need to operationalize your microservices. You’ll understand how
service configuration management, service discovery, messaging, logging and tracing,
and security all fit together to deliver a robust microservices environment. Finally,
you’ll see how your microservices can be deployed within a private or public cloud.
1.4 Why is this book relevant to you?
If you’ve gotten this far into reading chapter 1, I suspect that
You’re a Java developer.
You have a background in Spring.
You’re interested in learning how to build microservice-based applications.
You’re interested in how to use microservices to build cloud-based applications.
You want to know if Java and Spring are relevant technologies for building
microservice-based applications.
You’re interested in seeing what goes into deploying a microservice-based appli-
cation to the cloud.
I chose to write this book for two reasons. First, while I’ve seen many good books on the
conceptual aspects of microservices, I couldn’t a find a good Java-based book on imple-
menting microservices. While I’ve always considered myself a programming language
polyglot (someone who knows and speaks several languages), Java is my core develop-
ment language and Spring has been the development framework I “reach” for when-
ever I build a new application. When I first came across Spring Boot and Spring Cloud,
I was blown away. Spring Boot and Spring Cloud greatly simplified my development life
when it came to building microservice-based applications running in the cloud.
Second, as I’ve worked throughout my career as both an architect and engineer,
I’ve found that many times the technology books that I purchase have tended to go to
one of two extremes. They are either conceptual without concrete code examples, or
Licensed to <null>
37. 8 CHAPTER 1 Welcome to the cloud, Spring
are mechanical overviews of a particular framework or programming language. I
wanted a book that would be a good bridge and middle ground between the architec-
ture and engineering disciplines. As you read this book, I want to give you a solid
introduction to the microservice patterns development and how they’re used in real-
world application development, and then back these patterns up with practical and
easy-to-understand code examples using Spring Boot and Spring Cloud.
Let’s shift gears for a moment and walk through building a simple microservice
using Spring Boot.
1.5 Building a microservice with Spring Boot
I’ve always had the opinion that a software development framework is well thought
out and easy to use if it passes what I affectionately call the “Carnell Monkey Test.” If a
monkey like me (the author) can figure out a framework in 10 minutes or less, it has
promise. That’s how I felt the first time I wrote a sample Spring Boot service. I want
you to have to the same experience and joy, so let’s take a minute to see how to write a
simple “Hello World” REST-service using Spring Boot.
In this section, we’re not going to do a detailed walkthrough of much of the code
presented. Our goal is to give you a taste of writing a Spring Boot service. We’ll go into
much more detail in chapter 2.
Figure 1.3 shows what your service is going to do and the general flow of how
Spring Boot microservice will process a user’s request.
This example is by no means exhaustive or even illustrative of how you should
build a production-level microservice, but it should cause you to take a pause because
of how little code it took to write it. We’re not going to go through how to set up the
project build files or the details of the code until chapter 2. If you’d like to see the
Maven pom.xml file and the actual code, you can find it in the chapter 1 section of the
downloadable code. All the source code for chapter 1 can be retrieved from the
GitHub repository for the book at https://github.com/carnellj/spmia-chapter1.
NOTE Please make sure you read appendix A before you try to run the code
examples for the chapters in this book. Appendix A covers the general pro-
ject layout of all the projects in the book, how to run the build scripts, and
how to fire up the Docker environment. The code examples in this chapter
are simple and designed to be run natively right from your desktop without
the information in additional chapters. However, in later chapters you’ll
quickly begin using Docker to run all the services and infrastructure used in
this book. Don’t go too far into the book without reading appendix A on set-
ting up your desktop environment.
Licensed to <null>
38. 9
Building a microservice with Spring Boot
For this example, you’re going to have a single Java class called simpleservice/
src/com/thoughtmechanix/application/simpleservice/Application.java
that will be used to expose a REST endpoint called /hello.
The following listing shows the code for Application.java.
package com.thoughtmechanix.simpleservice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PathVariable;
Listing 1.1 Hello World with Spring Boot: a simple Spring microservice
A client makes an
HTTP GET request to
your Hello microservice.
The client receives the response from your
service as JSON. The success or failure of
the call is returned as an HTTP status code.
Once Spring Boot has identified the route
it will map any parameters defined inside
the route to a Java method that will carry
out the work.
Once all of the data has been mapped,
Spring Boot will execute the business logic.
Spring Boot will parse
the HTTP request and map
the route based on the HTTP
Verb, the URL, and potential
parameters defined for the
URL. A route maps to a
method in a Spring
RestController class.
For an HTTP PUT or Post,
a JSON passed in the HTTP
body is mapped to a
Java class.
Once the business logic
is executed, Spring Boot
will convert a Java object
to JSON.
GET http://localhost:8080/hello/john/carnell
HTTP STATUS:200
{"message": "Hello john carnell"}
Route mapping
Flow of Spring
Boot microservice
Parameter
destructuring
JSON->Java
object mapping
Business logic
execution
Java->JSON
object mapping
Figure 1.3 Spring Boot abstracts away the common REST microservice task (routing to business logic, parsing
HTTP parameters from the URL, mapping JSON to/from Java Objects), and lets the developer focus on the business
logic for the service.
Licensed to <null>
39. 10 CHAPTER 1 Welcome to the cloud, Spring
@SpringBootApplication
@RestController
@RequestMapping(value="hello")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@RequestMapping(value="/{firstName}/{lastName}",
method = RequestMethod.GET)
public String hello( @PathVariable("firstName") String firstName,
@PathVariable("lastName") String lastName) {
return String.format("{"message":"Hello %s %s"}",
firstName, lastName);
}
}
In listing 1.1 you’re basically exposing a single GET HTTP endpoint that will take two
parameters (firstName and lastName) on the URL and then return a simple JSON
string that has a payload containing the message “Hello firstName lastName”. If you
were to call the endpoint /hello/john/carnell on your service (which I’ll show
shortly) the return of the call would be
{"message":"Hello john carnell"}
Let’s fire up your service. To do this, go to the command prompt and issue the follow-
ing command:
mvn spring-boot:run
This command, mvn, will use a Spring Boot plug-in to start the application using an
embedded Tomcat server.
Java vs. Groovy and Maven vs. Gradle
The Spring Boot framework has strong support for both Java and the Groovy program-
ming languages. You can build microservices with Groovy and no project setup.
Spring Boot also supports both Maven and the Gradle build tools. I’ve limited the
examples in this book to Java and Maven. As a long-time Groovy and Gradle aficio-
nado, I have a healthy respect for the language and the build tool, but to keep the
book manageable and the material focused, I’ve chosen to go with Java and Maven
to reach the largest audience possible.
Tells the Spring Boot framework that this class
is the entry point for the Spring Boot service
Tells Spring Boot you’re going
to expose the code in this class
as a Spring RestController class
All URLs exposed in this application
will be prefaced with /hello prefix.
Spring Boot will expose an endpoint as a
GET-based REST endpoint that will take two
parameters: firstName and lastName.
Maps the firstName and lastName
parameters passed in on the URL to two
variables passed into the hello function
Returns a simple JSON string that you manually
build. In chapter 2 you won’t create any JSON.
Licensed to <null>
40. 11
Building a microservice with Spring Boot
Figure 1.4 Your Spring Boot service will communicate the endpoints exposed and the port of the service
via the console.
If everything starts correctly, you should see what’s shown in figure 1.4 from your
command-line window.
If you examine the screen in figure 1.4, you’ll notice two things. First, a Tomcat
server was started on port 8080. Second, a GET endpoint of /hello/{firstName}/
{lastName} is exposed on the server.
The service will listen to port 8080 for incoming HTTP requests.
Our /hello endpoint is mapped with two variables: firstName and lastName.
HTTP GET for the /hello/john/carnell endpoint
JSON payload returned back from the service
Figure 1.5 The response from the /hello endpoint shows the data you’ve requested represented as
a JSON payload.
Licensed to <null>
41. 12 CHAPTER 1 Welcome to the cloud, Spring
You’re going to call your service using a browser-based REST tool called POSTMAN
(https:/
/www.getpostman.com/). Many tools, both graphical and command line, are
available for invoking a REST-based service, but I’ll use POSTMAN for all my examples
in this book. Figure 1.5 shows the POSTMAN call to the http://localhost:8080/
hello/john/carnell endpoint and the results returned from the service.
Obviously, this simple example doesn’t demonstrate the full power of Spring Boot.
But what it should show is that you can write a full HTTP JSON REST-based service with
route-mapping of URL and parameters in Java with as few as 25 lines of code. As any
experienced Java developer will tell you, writing anything meaningful in 25 lines of
code in Java is extremely difficult. Java, while being a powerful language, has acquired
a reputation of being wordy compared to other languages.
We’re done with our brief tour of Spring Boot. We now have to ask this question:
because we can write our applications using a microservice approach, does this mean
we should? In the next section, we’ll walk through why and when a microservice
approach is justified for building your applications.
1.6 Why change the way we build applications?
We’re at an inflection point in history. Almost all aspects of modern society are now
wired together via the internet. Companies that used to serve local markets are sud-
denly finding that they can reach out to a global customer base. However, with a
larger global customer base also comes global competition. These competitive pres-
sures mean the following forces are impacting the way developers have to think about
building applications:
Complexity has gone way up—Customers expect that all parts of an organization
know who they are. “Siloed” applications that talk to a single database and don’t
integrate with other applications are no longer the norm. Today’s applications
need to talk to multiple services and databases residing not only inside a com-
pany’s data center, but also to external service providers over the internet.
Customers want faster delivery—Customers no longer want to wait for the next
annual release or version of a software package. Instead, they expect the features
in a software product to be unbundled so that new functionality can be released
quickly in weeks (even days) without having to wait for an entire product release.
Performance and scalability—Global applications make it extremely difficult to
predict how much transaction volume is going to be handled by an application
and when that transaction volume is going to hit. Applications need to scale up
across multiple servers quickly and then scale back down when the volume
needs have passed.
Customers expect their applications to be available—Because customers are one click
away from a competitor, a company’s applications must be highly resilient. Fail-
ures or problems in one part of the application shouldn’t bring down the entire
application.
Licensed to <null>
42. 13
What exactly is the cloud?
To meet these expectations, we, as application developers, have to embrace the para-
dox that to build high-scalable and highly redundant applications we need to break
our applications into small services that can be built and deployed independently of
one another. If we “unbundle” our applications into small services and move them
away from a single monolithic artifact, we can build systems that are
Flexible—Decoupled services can be composed and rearranged to quickly
deliver new functionality. The smaller the unit of code that one is working with,
the less complicated it is to change the code and the less time it takes to test
deploy the code.
Resilient—Decoupled services mean an application is no longer a single “ball of
mud” where a degradation in one part of the application causes the whole appli-
cation to fail. Failures can be localized to a small part of the application and con-
tained before the entire application experiences an outage. This also enables the
applications to degrade gracefully in case of an unrecoverable error.
Scalable—Decoupled services can easily be distributed horizontally across multi-
ple servers, making it possible to scale the features/services appropriately. With
a monolithic application where all the logic for the application is intertwined,
the entire application needs to scale even if only a small part of the application
is the bottleneck. Scaling on small services is localized and much more cost-
effective.
To this end, as we begin our discussion of microservices keep the following in mind:
Small, Simple, and Decoupled Services = Scalable, Resilient, and Flexible Applications
1.7 What exactly is the cloud?
The term “cloud” has become overused. Every software vendor has a cloud and every-
one’s platform is cloud-enabled, but if you cut through the hype, three basic models
exist in cloud-based computing. These are
Infrastructure as a Service (IaaS)
Platform as a Service (PaaS)
Software as a Service (SaaS)
To better understand these concepts, let’s map the everyday task of making a meal to
the different models of cloud computing. When you want to eat a meal, you have four
choices:
1 You can make the meal at home.
2 You can go to the grocery store and buy a meal pre-made that you heat up and
serve.
3 You can get a meal delivered to your house.
4 You can get in the car and eat at restaurant.
Licensed to <null>
43. 14 CHAPTER 1 Welcome to the cloud, Spring
Figure 1.6 The different cloud computing models come down to who’s
responsible for what: the cloud vendor or you.
Figure 1.6 shows each model.
The difference between these options is about who’s responsible for cooking these
meals and where the meal is going to be cooked. In the on-premise model, eating a
meal at home requires you to do all the work, using your own oven and ingredients
already in the home. A store-bought meal is like using the Infrastructure as a Service
(IaaS) model of computing. You’re using the store’s chef and oven to pre-bake the
meal, but you’re still responsible for heating the meal and eating it at the house (and
cleaning up the dishes afterward).
In a Platform as a Service (PaaS) model you still have responsibility for the meal,
but you further rely on a vendor to take care of the core tasks associated with making
a meal. For example, in a PaaS model, you supply the plates and furniture, but the res-
taurant owner provides the oven, ingredients, and the chef to cook them. In the Soft-
ware as a Service (SaaS) model, you go to a restaurant where all the food is prepared
for you. You eat at the restaurant and then you pay for the meal when you’re done.
you also have no dishes to prepare or wash.
The key items at play in each of these models are ones of control: who’s responsi-
ble for maintaining the infrastructure and what are the technology choices available
for building the application? In a IaaS model, the cloud vendor provides the basic
infrastructure, but you’re accountable for selecting the technology and building the
final solution. On the other end of the spectrum, with a SaaS model, you’re a passive
consumer of the service provided by the vendor and have no input on the technology
selection or any accountability to maintain the infrastructure for the application.
Furniture
Plates
Oven
Ingredients
Chef
Homemade
On premise
Furniture
Plates
Oven
Ingredients
You manage Provider manages
Chef
Store bought
IaaS
Furniture
Plates
Oven
Ingredients
Chef
Delivered
PaaS
Furniture
Plates
Oven
Ingredients
Chef
Restaurant
SaaS
Licensed to <null>
44. 15
Why the cloud and microservices?
1.8 Why the cloud and microservices?
One of the core concepts of a microservice-based architecture is that each service is
packaged and deployed as its own discrete and independent artifact. Service instances
should be brought up quickly and each instance of the service should be indistin-
guishable from another.
As a developer writing a microservice, sooner or later you’re going to have to
decide whether your service is going to be deployed to one of the following:
Physical server—While you can build and deploy your microservices to a physi-
cal machine(s), few organizations do this because physical servers are con-
strained. You can’t quickly ramp up the capacity of a physical server and it can
become extremely costly to scale your microservice horizontally across multiple
physical servers.
Virtual machine images—One of the key benefits of microservices is their ability
to quickly start up and shut down microservice instances in response to scalabil-
ity and service failure events. Virtual machines are the heart and soul of the
Emerging cloud platforms
I’ve documented the three core cloud platform types (IaaS, PaaS, SaaS) that are in
use today. However, new cloud platform types are emerging. These new platforms
include Functions as a Service (FaaS) and Container as a Service (CaaS). FaaS-based
(https://en.wikipedia.org/wiki/Function_as_a_Service) applications use technolo-
gies like Amazon’s Lambda technologies and Google Cloud functions to build appli-
cations deployed as “serverless” chunks of code that run completely on the cloud
provider’s platform computing infrastructure. With a FaaS platform, you don’t have to
manage any server infrastructure and only pay for the computing cycles required to
execute the function.
With the Container as a Service (CaaS) model, developers build and deploy their
microservices as portable virtual containers (such as Docker) to a cloud provider.
Unlike an IaaS model, where you the developer have to manage the virtual machine
the service is deployed to, with CaaS you’re deploying your services in a lightweight
virtual container. The cloud provider runs the virtual server the container is running
on as well as the provider’s comprehensive tools for building, deploying, monitoring,
and scaling containers. Amazon’s Elastic Container Service (ECS) is an example of a
CaaS-based platform. In chapter 10 of this book, we’ll see how to deploy the
microservices you’ve built to Amazon ECS.
It’s important to note that with both the FaaS and CaaS models of cloud computing,
you can still build a microservice-based architecture. Remember, the concept of
microservices revolves around building small services, with limited responsibility,
using an HTTP-based interface to communicate. The emerging cloud computing plat-
forms, such as FaaS and CaaS, are really about alternative infrastructure mecha-
nisms for deploying microservices.
Licensed to <null>
45. 16 CHAPTER 1 Welcome to the cloud, Spring
major cloud providers. A microservice can be packaged up in a virtual machine
image and multiple instances of the service can then be quickly deployed and
started in either a IaaS private or public cloud.
Virtual container—Virtual containers are a natural extension of deploying your
microservices on a virtual machine image. Rather than deploying a service to a
full virtual machine, many developers deploy their services as Docker contain-
ers (or equivalent container technology) to the cloud. Virtual containers run
inside a virtual machine; using a virtual container, you can segregate a single vir-
tual machine into a series of self-contained processes that share the same virtual
machine image.
The advantage of cloud-based microservices centers around the concept of elasticity.
Cloud service providers allow you to quickly spin up new virtual machines and contain-
ers in a matter of minutes. If your capacity needs for your services drop, you can spin
down virtual servers without incurring any additional costs. Using a cloud provider to
deploy your microservices gives you significantly more horizontal scalability (adding
more servers and service instances) for your applications. Server elasticity also means
that your applications can be more resilient. If one of your microservices is having prob-
lems and is falling over, spinning up new service instances can you keep your applica-
tion alive long enough for your development team to gracefully resolve the issue.
For this book, all the microservices and corresponding service infrastructure will
be deployed to an IaaS-based cloud provider using Docker containers. This is a com-
mon deployment topology used for microservices:
Simplified infrastructure management—IaaS cloud providers give you the ability to
have the most control over your services. New services can be started and
stopped with simple API calls. With an IaaS cloud solution, you only pay for the
infrastructure that you use.
Massive horizontal scalability—IaaS cloud providers allow you to quickly and suc-
cinctly start one or more instances of a service. This capability means you can
quickly scale services and route around misbehaving or failing servers.
High redundancy through geographic distribution—By necessity, IaaS providers have
multiple data centers. By deploying your microservices using an IaaS cloud
provider, you can gain a higher level of redundancy beyond using clusters in a
data center.
Licensed to <null>
46. 17
Microservices are more than writing the code
The services built in this book are packaged as Docker containers. One of the reasons
why I chose Docker is that as a container technology, Docker is deployable to all the
major cloud providers. Later in chapter 10, I demonstrate how to package microser-
vices using Docker and then deploy these containers to Amazon’s cloud platform.
1.9 Microservices are more than writing the code
While the concepts around building individual microservices are easy to understand,
running and supporting a robust microservice application (especially when running
Why not PaaS-based microservices?
Earlier in the chapter we discussed three types of cloud platforms (Infrastructure as
a Service, Platform as a Service, and Software as a Services). For this book, I’ve cho-
sen to focus specifically on building microservices using an IaaS-based approach.
While certain cloud providers will let you abstract away the deployment infrastructure
for your microservice, I’ve chosen to remain vendor-independent and deploy all parts
of my application (including the servers).
For instance, Amazon, Cloud Foundry, and Heroku give you the ability to deploy your
services without having to know about the underlying application container. They pro-
vide a web interface and APIs to allow you to deploy your application as a WAR or JAR
file. Setting up and tuning the application server and the corresponding Java con-
tainer are abstracted away from you. While this is convenient, each cloud provider’s
platform has different idiosyncrasies related to its individual PaaS solution.
An IaaS approach, while more work, is portable across multiple cloud providers and
allows us to reach a wider audience with our material. Personally, I’ve found that
PaaS-based cloud solutions can allow you to quickly jump start your development
effort, but once your application reaches enough microservices, you start to need the
flexibility the IaaS style of cloud development provides.
Earlier in the chapter, I mentioned new cloud computing platforms such as Function
as a Service (FaaS) and Container as a Service (CaaS). If you’re not careful, FaaS-
based platforms can lock your code into a cloud vendor platform because your code
is deployed to a vendor-specific runtime engine. With a FaaS-based model, you might
be writing your service using a general programming language (Java, Python, JavaS-
cript, and so on), but you’re still tying yourself heavily to the underlying vendor APIs
and runtime engine that your function will be deployed to.
Licensed to <null>
47. 18 CHAPTER 1 Welcome to the cloud, Spring
in the cloud) involves more than writing the code for the service. Writing a robust ser-
vice includes considering several topics. Figure 1.7 highlights these topics.
Let’s walk through the items in figure 1.7 in more detail:
Right-sized—How do you ensure that your microservices are properly sized so
that you don’t have a microservice take on too much responsibility? Remember,
properly sized, a service allows you to quickly make changes to an application
and reduces the overall risk of an outage to the entire application.
Location transparent—How you we manage the physical details of service invoca-
tion when in a microservice application, multiple service instances can quickly
start and shut down?
Resilient—How do you protect your microservice consumers and the overall
integrity of your application by routing around failing services and ensuring
that you take a “fail-fast” approach?
Repeatable—How do you ensure that every new instance of your service brought
up is guaranteed to have the same configuration and code base as all the other
service instances in production?
Scalable—How do you use asynchronous processing and events to minimize the
direct dependencies between your services and ensure that you can gracefully
scale your microservices?
This book takes a patterns-based approach as we answer these questions. With a pat-
terns-based approach, we lay out common designs that can be used across different
How do you manage the physical location
so services instances can be added and
removed without impacting service clients?
How do you make sure
the service is focused
on one area of
responsibility?
How do you make sure
when there is a problem
with a service, service
clients “fail fast”?
How do you ensure
that your applications
can scale quickly with
minimal dependencies
between services?
How do you ensure that every
time a new service instance is
started it always has the same
code and configuration as
existing instance(s)?
Right-sized
Location
transparent
Your microservice Resilient
Scalable Repeatable
Figure 1.7 Microservices are more than the business logic. You need to think about the environment
where the services are going to run and how the services will scale and be resilient.
Licensed to <null>
48. 19
Microservices are more than writing the code
technology implementations. While we’ve chosen to use Spring Boot and Spring
Cloud to implement the patterns we’re going to use in this book, nothing will keep
you from taking the concepts presented here and using them with other technology
platforms. Specifically, we cover the following six categories of microservice patterns:
Core development patterns
Routing patterns
Client resiliency patterns
Security patterns
Logging and tracing patterns
Build and deployment patterns
Let’s walk through these patterns in more detail.
1.9.1 Core microservice development pattern
The core development microservice development pattern addresses the basics of
building a microservice. Figure 1.8 highlights the topics we’ll cover around basic ser-
vice design.
Figure 1.8 When designing your microservice, you have to think about how the service will be consumed
and communicated with.
Communication protocols:
How your client and service
communicate data back
and forth
Configuration management:
How your services manage
their application-specific
configuration so that the
code and configuration
are independent entities
Service granularity: What is the
right level of responsibility the
service should have?
Interface design: How you are
going to expose your service
endpoints to clients
Event processing: How you can
use events to communicate
state and data changes
between services
Web client Microservice
Microservice
Communication
protocols
Service
granularity
Interface
design
Configuration
management
Event
processing
Licensed to <null>
49. 20 CHAPTER 1 Welcome to the cloud, Spring
Service granularity—How do you approach decomposing a business domain
down into microservices so that each microservice has the right level of respon-
sibility? Making a service too coarse-grained with responsibilities that overlap
into different business problems domains makes the service difficult to main-
tain and change over time. Making the service too fine-grained increases the
overall complexity of the application and turns the service into a “dumb” data
abstraction layer with no logic except for that needed to access the data store. I
cover service granularity in chapter 2.
Communication protocols—How will developers communicate with your service?
Do you use XML (Extensible Markup Language), JSON (JavaScript Object Nota-
tion), or a binary protocol such as Thrift to send data back and forth your
microservices? We’ll go into why JSON is the ideal choice for microservices and
has become the most common choice for sending and receiving data to
microservices. I cover communication protocols in chapter 2.
Interface design—What’s the best way to design the actual service interfaces that
developers are going to use to call your service? How do you structure your ser-
vice URLs to communicate service intent? What about versioning your services?
A well-design microservice interface makes using your service intuitive. I cover
interface design in chapter 2.
Configuration management of service—How do you manage the configuration of
your microservice so that as it moves between different environments in the
cloud you never have to change the core application code or configuration? I
cover managing service configuration in chapter 3.
Event processing between services—How do you decouple your microservice using
events so that you minimize hardcoded dependencies between your services
and increase the resiliency of your application? I cover event processing
between services in chapter 8.
1.9.2 Microservice routing patterns
The microservice routing patterns deal with how a client application that wants to
consume a microservice discovers the location of the service and is routed over to it.
In a cloud-based application, you might have hundreds of microservice instances run-
ning. You’ll need to abstract away the physical IP address of these services and have a
single point of entry for service calls so that you can consistently enforce security and
content policies for all service calls.
Service discovery and routing answer the question, “How do I get my client’s
request for a service to a specific instance of a service?”
Service discovery—How do you make your microservice discoverable so client
applications can find them without having the location of the service hard-
coded into the application? How do you ensure that misbehaving microservice
instances are removed from the pool of available service instances? I cover ser-
vice discovery in chapter 4.
Licensed to <null>
50. 21
Microservices are more than writing the code
Service routing—How do you provide a single entry point for all of your services so
that security policies and routing rules are applied uniformly to multiple services
and service instances in your microservice applications? How do you ensure that
each developer in your team doesn’t have to come up with their own solutions for
providing routing to their services? I cover service routing in chapter 6.
In figure 1.9, service discovery and service routing appear to have a hard-coded
sequence of events between them (first comes service routing and the service discov-
ery). However, the two patterns aren’t dependent on one another. For instance, we
can implement service discovery without service routing. You can implement service
routing without service discovery (even though its implementation is more difficult).
1.9.3 Microservice client resiliency patterns
Because microservice architectures are highly distributed, you have to be extremely
sensitive in how you prevent a problem in a single service (or service instance) from
Service routing gives the
microservice client a single
logical URL to talk to and acts
as a policy enforcement point
for things like authorization,
authentication, and
content checking.
Service discovery abstracts
away the physical location
of the service from the client.
New microservice instances
can be added to scale up, and
unhealthy service instances
can be transparently removed
from the service.
172.18.32.100 172.18.32.101
Microservice A (two instances)
172.18.38.96 172.18.38.97
Microservice B (two instances)
Web client
http://myapp.api/servicea http://myapp.api/serviceb
Microservice
Figure 1.9 Service discovery and routing are key parts of any large-scale microservice
application.
Licensed to <null>
51. 22 CHAPTER 1 Welcome to the cloud, Spring
cascading up and out to the consumers of the service. To this end, we’ll cover four cli-
ent resiliency patterns:
Client-side load balancing—How do you cache the location of your service
instances on the service client so that calls to multiple instances of a microser-
vice are load balanced to all the health instances of that microservice?
Circuit breakers pattern—How do you prevent a client from continuing to call a
service that’s failing or suffering performance problems? When a service is run-
ning slowly, it consumes resources on the client calling it. You want failing
microservice calls to fail fast so that the calling client can quickly respond and
take an appropriate action.
Fallback pattern—When a service call fails, how do you provide a “plug-in” mech-
anism that will allow the service client to try to carry out its work through alter-
native means other than the microservice being called?
Bulkhead pattern—Microservice applications use multiple distributed resources
to carry out their work. How do you compartmentalize these calls so that the mis-
behavior of one service call doesn’t negatively impact the rest of the application?
Figure 1.10 With microservices, you must protect the service caller from a poorly behaving service.
Remember, a slow or down service can cause disruptions beyond the immediate service.
The circuit breaker pattern
ensures that a service client
does not repeatedly call a failing
service. Instead, a circuit breaker
"fails fast" to protect the client.
How do you segregate different
service calls on a client to make
sure one misbehaving service
does not take up all the resources
on the client?
When a client does fail, is there
an alternative path the client can
take to retrieve data from or take
action with?
172.18.32.100
The service client caches
microservice endpoints retrieved
from the service discovery and
ensures that the service calls are
load balanced between instances.
172.18.32.101
Microservice A (two instances)
172.18.38.96 172.18.38.97
Microservice B (two instances)
Web client
http://myapp.api/servicea http://myapp.api/serviceb
Microservice
Client-side load
balancing
Circuit
breaker
Fallback
Bulkhead
Licensed to <null>
52. 23
Microservices are more than writing the code
Figure 1.10 shows how these patterns protect the consumer of service from being
impacted when a service is misbehaving. I cover these four topics in chapter 5.
1.9.4 Microservice security patterns
I can’t write a book on microservices without talking about microservice security. In
chapter 7 we’ll cover three basic security patterns. These patterns are
Authentication—How do you determine the service client calling the service is
who they say they are?
Authorization—How do you determine whether the service client calling a
microservice is allowed to undertake the action they’re trying to undertake?
Credential management and propagation—How do you prevent a service client from
constantly having to present their credentials for service calls involved in a trans-
action? Specifically, we’ll look at how token-based security standards such as
OAuth2 and JavaScript Web Tokens (JWT) can be used to obtain a token that can
be passed from service call to service call to authenticate and authorize the user.
Figure 1.11 shows how you can implement the three patterns described previously to
build an authentication service that can protect your microservices.
At this point I’m not going to go too deeply into the details of figure 1.10. There’s
a reason why security requires a whole chapter. (It could honestly be a book in itself.)
Figure 1.11 Using a token-based security scheme, you can implement service authentication and
authorization without passing around client credentials.
2. The resource owner grants which
applications/users can access the
resource via the authentication service
3. When the user tries to access
a protected service, they must
authenticate and obtain a token
from the authentication service.
4. The token server authenticates
the user and validates tokens
presented to it
1. The service you
want to protect
Application trying to
access a protected
resource
Token
authentication
server
Protected
resource
The user
Resource owner
Licensed to <null>
53. 24 CHAPTER 1 Welcome to the cloud, Spring
1.9.5 Microservice logging and tracing patterns
The beauty of the microservice architecture is that a monolithic application is broken
down into small pieces of functionality that can be deployed independently of one
another. The downside of a microservice architecture is that it’s much more difficult
to debug and trace what the heck is going on within your application and services.
For this reason, we’ll look at three core logging and tracing patterns:
Log correlation—How do you tie together all the logs produced between services
for a single user transaction? With this pattern, we’ll look at how to implement a
correlation ID, which is a unique identifier that will be carried across all service
calls in a transaction and can be used to tie together log entries produced from
each service.
Log aggregation—With this pattern we’ll look at how to pull together all of the
logs produced by your microservices (and their individual instances) into a sin-
gle queryable database. We’ll also look at how to use correlation IDs to assist in
searching your aggregated logs.
Microservice tracing—Finally, we’ll explore how to visualize the flow of a client
transaction across all the services involved and understand the performance
characteristics of services involved in the transaction.
Figure 1.12 shows how these patterns fit together. We’ll cover the logging and tracing
patterns in greater detail in chapter 9.
Figure 1.12 A well-thought-out logging and tracing strategy makes debugging transactions across
multiple services manageable.
Log correlation: All service log
entries have a correlation ID that
ties the log entry to a single transaction.
Log aggegration: An aggregation
mechanism collects all of the logs
from all the services instances.
As data comes into a central
data store, it is indexed and
stored in a searchable format.
Microservice transaction tracing: The development and operations teams
can query the log data to find individual transactions. They should also be
able to visualize the flow of all the services involved in a transaction.
Service instance A Service instance A Service instance B Service instance B Service instance C
Licensed to <null>
54. 25
Microservices are more than writing the code
1.9.6 Microservice build/deployment patterns
One of the core parts of a microservice architecture is that each instance of a
microservice should be identical to all its other instances. You can’t allow “configura-
tion drift” (something changes on a server after it’s been deployed) to occur, because
this can introduce instability in your applications.
To this end, our goal is to integrate the configuration of your infrastructure right into
your build-deployment process so that you no longer deploy software artifacts such as
a Java WAR or EAR to an already-running piece of infrastructure. Instead, you want to
build and compile your microservice and the virtual server image it’s running on as
part of the build process. Then, when your microservice gets deployed, the entire
machine image with the server running on it gets deployed.
Figure 1.13 illustrates this process. At the end of the book we’ll look at how to
change your build and deployment pipeline so that your microservices and the servers
they run on are deployed as a single unit of work. In chapter 10 we cover the following
patterns and topics:
Build and deployment pipeline—How do you create a repeatable build and deploy-
ment process that emphasizes one-button builds and deployment to any envi-
ronment in your organization?
Infrastructure as code—How do you treat the provisioning of your services as code
that can be executed and managed under source control?
Immutable servers—Once a microservice image is created, how do you ensure
that it’s never changed after it has been deployed?
Phoenix servers—The longer a server is running, the more opportunity for con-
figuration drift. How do you ensure that servers that run microservices get torn
down on a regular basis and recreated off an immutable image?
A phrase too often said
“I made only one small change on the stage server, but I forgot to make the change
in production.” The resolution of many down systems when I’ve worked on critical sit-
uations teams over the years has often started with those words from a developer or
system administrator. Engineers (and most people in general) operate with good
intentions. They don’t go to work to make mistakes or bring down systems. Instead
they’re doing the best they can, but they get busy or distracted. They tweak some-
thing on a server, fully intending to go back and do it in all the environments.
At a later point, an outage occurs and everyone is left scratching their heads wondering
what’s different between the lower environments in production. I’ve found that the
small size and limited scope of a microservice makes it the perfect opportunity to intro-
duce the concept of “immutable infrastructure” into an organization: once a service
is deployed, the infrastructure it’s running on is never touched again by human hands.
An immutable infrastructure is a critical piece of successfully using a microservice
architecture, because you have to guarantee in production that every microservice
instance you start for a particular microservice is identical to its brethren.
Licensed to <null>
56. “Yes, sir; that is how it must have been. I didn’t believe it, sir, for a
long time afterwards: not for several hours.”
“A long time, that,” said Tod, an unpleasant sound of mockery in his
tone.
“No, sir; I know it’s not much, counting by time,” answered Lease
patiently. “But nobody can ever picture how long those hours
seemed to me. They were like years. I couldn’t get the idea into me
at all that I had not set the points as usual; it seemed a thing
incredible; but, try as I would, I was unable to call to mind having
done it.”
“Well, I must say that is a nice thing to confess to, Lease! And there
was I, yesterday afternoon, taking your part and quarrelling with my
father.”
“I am sorry for that, sir. I am not worth having my part taken in
anything, since that happened.”
“But how came you to do it?”
“It’s a question I shall never be able to answer, sir. We had a busy
day, were on the run from morning till night, and there was a great
deal of confusion at the station: but it was no worse than many a
day that has gone before it.”
“Well, I shall be off,” said Tod. “This has shut me up. I thought of
going in for you, Lease, finding every one else was dead against
you. A misfortune is a misfortune, but wilful carelessness is sin: and
my father and his wife and my little sister were in the train. Come
along, Johnny.”
“Directly, Tod. I’ll catch you up. I say, Lease, how will it end?” I
asked, as Tod went on.
“It can’t end better than two years’ imprisonment for me, sir; and I
suppose it may end worse. It is not that I think of.”
57. “What else, then?”
“Four dead already, sir; four—and one soon to follow them, making
five,” he answered, his voice hushed to a whisper. “Master Johnny, it
lies on me always, a dreadful weight never to be got rid of. When I
was young, I had a sort of low fever, and used to see in my dreams
some dreadful task too big to be attempted, and yet I had to do it;
and the weight on my mind was awful. I didn’t think, till now, such a
weight could fall in real life. Sleeping or waking, sir, I see those four
before me dead. Squire Todhetley told me that I had their lives on
my soul. And it is so.”
I did not know what to answer.
“So you see, sir, I don’t think much of the imprisonment; if I did, I
might be wanting to get the suspense over. It’s not any term of
imprisonment, no, not though it were for life, that can wash out the
past. I’d give my own life, sir, twice over if that could undo it.”
Lease had his arm on the gate as he spoke, leaning forward. I could
not help feeling sorry for him.
“If people knew how I’m punished within myself, Master Johnny,
they’d perhaps not be so harsh upon me. I have never had a proper
night’s rest since it happened, sir. I have to get up and walk about in
the middle of the night because I can’t lie. The sight of the dawn
makes me sick, and I say to myself, How shall I get through the
day? When bed-time comes, I wonder how I shall lie till morning.
Often I wish it had pleased God to take me before that day had
happened.”
“Why don’t they get the inquest over, Lease?”
“There’s something or other always brought up to delay it, sir. I don’t
see the need of it. If it would bring the dead back to life, why, they
might delay it; but it won’t. They might as well let it end, and
sentence me, and have done with it. Each time when I go back
home through Crabb Lane, the men and women call out, ‘What, put
58. off again!’ ‘What, ain’t he in gaol yet!’ Which is the place they say I
ought to have been in all along.”
“I suppose the coroner knows you’ll not run away, Lease.”
“Everybody knows that, sir.”
“Some would, though, in your place.”
“I don’t know where they’d run to,” returned Lease. “They couldn’t
run away from their own minds—and that’s the worst part of it.
Sometimes I wonder whether I shall ever get it off mine, sir, or if I
shall have it on me, like this, to the end of my life. The Lord knows
what it is to me; nobody else does.”
You cannot always make things fit into one another. I was thinking
so as I left Lease and went after Tod. It was awful carelessness not
to have set the points; causing death, and sorrow, and distress to
many people. Looking at it from their side, the pointsman was
detestable; only fit, as the Squire said, to be hanged. But looking at
it side by side with Lease, seeing his sad face, his self-reproach, and
his patient suffering, it seemed altogether different; and the two
aspects would not by any means fit in together.
Christmas week, and the absence of a juror who had gone out
visiting, made another excuse for putting off the inquest to the next
week. When that came, the coroner was ill. There seemed to be no
end to the delays, and the public steam was getting up in
consequence. As to Lease, he went about like a man who is looking
for something that he has lost and cannot find.
One day, when the ice lay in Crabb Lane, and I was taking the slides
on my way through it to join Tod, who had gone rabbit-shooting, a
little girl ran across my feet, and was knocked down. I fell too; and
the child began to cry. Picking her up, I saw it was Polly Lease.
“You little stupid! why did you run into my path like that?”
59. “Please, sir, I didn’t see you,” she sobbed. “I was running after
father. Mother saw him in the field yonder, and sent me to tell him
we’d got a bit o’ fire.”
Polly had grazed both her knees; they began to bleed just a little,
and she nearly went into convulsions at sight of the blood. I carried
her in. There was about a handful of fire in the grate. The mother
sat on a low stool, close into it, nursing one of the children, and the
rest sat on the floor.
“I never saw such a child as this in all my life, Mrs. Lease. Because
she has hurt her knees a bit, and sees a drop of blood, she’s going
to die of fright. Look here.”
Mrs. Lease put the boy down and took Polly, who was trembling all
over with her deep low sobs.
“It was always so, sir,” said Mrs. Lease; “always since she was a
baby. She is the timorest-natured child possible. We have tried
everything; coaxing and scolding too; but we can’t get her out of it.
If she pricks her finger her face turns white.”
“I’d be more of a woman than cry at nothing, if I were you, Polly,”
said I, sitting on the window-ledge, while Mrs. Lease washed the
knees; which were hardly damaged at all when they came to be
examined. But Polly only clung to her mother, with her face hidden,
and giving a deep sob now and then.
“Look up, Polly. What’s this!”
I put it into her hand as I spoke; a bath bun that I had been
carrying with me, in case I did not get home to luncheon. Polly
looked round, and the sight dried the tears on her swollen face. You
never saw such a change all in a moment, or such eager, glad little
eyes as hers.
“Divide it mother,” said she. “Leave a bit for father.”
60. Two of them came flocking round like a couple of young wolves; the
youngest couldn’t get up, and the one Mrs. Lease had been nursing
stayed on the floor where she put him. He had a sickly face, with
great bright grey eyes, and hot, red lips.
“What’s the matter with him, Mrs. Lease?”
“With little Tom, sir? I think it’s a kind of fever. He never was strong;
none of them are: and of course these bad times can but tell upon
us.”
“Don’t forget father, mother,” said Polly. “Leave the biggest piece for
father.”
“Now I tell you all what it is,” said I to the children, when Mrs. Lease
began to divide it into half-a-dozen pieces, “that bun’s for Polly,
because she has hurt herself: you shall not take any of it from her.
Give it to Polly, Mrs. Lease.”
Of all the uproars ever heard, those little cormorants set up the
worst. Mrs. Lease looked at me.
“They must have a bit, sir: they must indeed. Polly wouldn’t eat all
herself, Master Ludlow; you couldn’t get her to do it.”
But I was determined Polly should have it. It was through me she
got hurt; and besides, I liked her.
“Now just listen, you little pigs. I’ll go to Ford’s, the baker’s, and
bring you all a bun a-piece, but Polly must have this one. They have
lots of currants in them, those buns, for children that don’t squeal.
How many are there of you? One, two, three,—— four.”
Catching up my cap, I was going out when Mrs. Lease touched me.
“Do you really mean it, sir?” she asked in a whisper.
“Mean what? That I am going to bring the buns? Of course I mean
it. I’ll be back with them directly.”
61. “Oh, sir—but do forgive me for making free to ask such a thing—if
you would only let it be a half-quartern loaf instead?”
“A half-quartern loaf!”
“They’ve not had a bit between their lips this day, Master Ludlow,”
she said, catching her breath, as her face, which had flushed, turned
pale again. “Last night I divided between the four of them a piece of
bread half the size of my hand; Tom, he couldn’t eat.”
I stared for a minute. “How is it, Mrs. Lease? can you not get
enough food?”
“I don’t know where we should get it from, sir. Lease has not broken
his fast since yesterday at midday.”
Dame Ford put the loaf in paper for me, wondering what on earth I
wanted with it, as I could see by her inquisitive eyes, but not liking
to ask; and I carried it back with the four buns. They were little
wolves and nothing else when they saw the food.
“How has this come about, Mrs. Lease?” I asked, while they were
eating the bread she cut them, and she had taken Tom on her lap
again.
“Why, sir, it is eight weeks now, or hard upon it, since my husband
earned anything. They didn’t even pay him for the last week he was
at work, as the accident happened in it. We had nothing in hand;
people with only eighteen shillings a week and five children to feed,
can’t save; and we have been living on our things. But there’s
nothing left now to make money of—as you may see by the bare
room, sir.”
“Does not any one help you?”
“Help us!” returned Mrs. Lease. “Why, Master Ludlow, people, for the
most part, are so incensed against my husband, that they’d take the
bread out of our mouths, instead of putting a bit into them. All their
help goes to poor Nancy Bowen and her children: and Lease is glad
62. it should be so. When I carried Tom to Mr. Cole’s yesterday, he said
that what the child wanted was nourishment.”
“This must try Lease.”
“Yes,” she said, her face flushing again, but speaking very quietly.
“Taking one thing with another, I am not sure but it is killing him.”
After this break, I did not care to go to the shooting, but turned
back to Crabb Cot. Mrs. Todhetley was alone in the bow-windowed
parlour, so I told her of the state the Leases were in, and asked if
she would not help them.
“I don’t know what to say about it, Johnny,” she said, after a pause.
“If I were willing, you know Mr. Todhetley would not be so. He can’t
forgive Lease for his carelessness. Every time Lena wakes up from
sleep in a fright, fancying it is another accident, his anger returns to
him. We often hear her crying out, you know, down here in an
evening.”
“The carelessness was no fault of Lease’s children, that they should
suffer for it.”
“When you grow older, Johnny, you will find that the consequences
of people’s faults fall more on others than on themselves. It is very
sad the Leases should be in this state; I am sorry for them.”
“Then you’ll help them a bit, good mother.”
Mrs. Todhetley was always ready to help any one, not needing to be
urged; on the other hand, she liked to yield implicitly to the opinions
of the Squire. Between the two, she went into a dilemma.
“Suppose it were Lena, starving for want of food and warmth?” I
said. “Or Hugh sick with fever, as that young Tom is? Those children
have done no more harm than ours.”
Mrs. Todhetley put her hand up to her face, and her mild eyes
looked nearly as sad as Lease’s.
63. “Will you take it to them yourself, Johnny, in a covered basket, and
not let it be seen? That is, make it your own doing?”
“Yes.”
“Go to the kitchen then, and ask Molly. There are some odds and
ends of things in the larder that will not be particularly wanted. You
see, Johnny, I do not like to take an active part in this; it would
seem like opposing the Squire.”
Molly was stooping before the big fire, basting the meat, in one of
her vile humours. If I wanted to rob the larder, I must do it, she
cried; it was my business, not hers; and she dashed the basting
spoon across the table by way of accompaniment.
I gave a good look round the larder, and took a raised pork-pie that
had a piece cut out of it, and a leg of mutton three parts eaten. On
the shelf were a dozen mince-pies, just out of their patty-pans; I
took six and left six. Molly, screwing her face round the kitchen-door,
caught sight of them as they went into the basket, and rushing after
me out of the house, shrieked out for her mince-pies.
The race went on. She was a woman not to be daunted. Just as we
turned round by the yellow barn, I first, she raving behind, the
Squire pounced upon us, asking what the uproar meant. Molly told
her tale. I was a thief, and had gone off with the whole larder, more
particularly with her mince-pies.
“Open the basket, Johnny,” said the Squire: which was the one Tod
and I used when we went fishing.
No sooner was it done than Molly marched off with the pies in
triumph. The Pater regarded the pork-pie and the meat with a
curious gaze.
“This is for you and Joe, I suppose. I should like to know for how
many more.”
64. I was one of the worst to conceal things, when taken-to like this,
and he got it all out of me in no time. And then he put his hand on
my shoulder and ordered me to say who the things were for. Which I
had to do.
Well, there was a row. He wanted to know what I meant by being
wicked enough to give food to Lease. I said it was for the children.
I’m afraid I almost cried, for I did not like him to be angry with me,
but I know I promised not to eat any dinner at home for three days
if he would let me take the meat. Molly’s comments, echoing
through the house, betrayed to Mrs. Todhetley what had happened,
and she came down the road with a shawl over her head. She told
the Squire the truth then: that she had sanctioned it. She said she
feared the Leases were quite in extremity, and begged him to let the
meat go.
“Be off for this once, you young thief,” stamped the Squire, “but
don’t let me catch you at anything of this sort again.”
So the meat went to the Leases, and two loaves that Mrs. Todhetley
whispered me to order for them at Ford’s. When I reached home
with the empty basket, they were going in to dinner. I took a book
and stayed in the parlour. In a minute or two the Squire sent to ask
what I was doing that for.
“It’s all right, Thomas. I don’t want any dinner to-day.”
Old Thomas went away and returned again, saying the master
ordered me to go in. But I wouldn’t do anything of the sort. If he
forgot the bargain, I did not.
Out came the Squire, his face red, napkin in hand, and laid hold of
me by the shoulders.
“You obstinate young Turk! How dare you defy me? Come along.”
“But it is not to defy you, sir. It was a bargain, you know; I
promised.”
65. “What was a bargain?”
“That I should not have any dinner for three days. Indeed I meant
it.”
The Squire’s answer was to propel me into the dining-room. “Move
down, Joe,” he said, “I’ll have him by me to-day. I’ll see whether he
is to starve himself out of bravado.”
“Why, what’s up?” asked Tod, as he went to a lower seat. “What
have you been doing, Johnny?”
“Never mind,” said the Squire, putting enough mutton on my plate
for two. “You eat that, Mr. Johnny?”
It went on so throughout dinner. Mrs. Todhetley gave me a big share
of apple pudding; and, when the macaroni came on, the Squire
heaped my plate. And I know it was all done to show he was not
really angry with me for having taken the things to the Leases.
Mr. Cole, the surgeon, came in after dinner, and was told of my
wickedness. Lena ran up to me and said might she send her new
sixpence to the poor little children who had no bread to eat.
“What’s that Lease about, that he does not go to work?” asked the
Squire, in loud tones. “Letting folks hear that his young ones are
starving!”
“The man can’t work,” said Mr. Cole. “He is out on probation, you
know, waiting for the verdict, and the sentence on him that is to
follow.”
“Then why don’t they return their verdict and sentence him?”
demanded the Squire, in his hot way.
“Ah!” said Mr. Cole, “it’s what they ought to have done long ago.”
“What will it be! Transportation?”
66. “I should take care it was not, if I were on the jury. The man had
too much work on him that day, and had had nothing to eat or drink
for too many hours.”
“I won’t hear a word in his defence,” growled the Squire.
When the jury met for the last time, Lease was ill. A day or two
before that, some one had brought Lease word that Roberts, who
had been lingering all that time in the infirmary at Worcester, was
going at last. Upon which Lease started to see him. It was not the
day for visitors at the infirmary, but he gained admittance. Roberts
was lying in the accident ward, with his head low and a blue look in
his face; and the first thing Lease did, when he began to speak, was
to burst out crying. The man’s strength had gone down to nothing
and his spirit was broken. Roberts made out that he was speaking of
his distress at having been the cause of the calamity, and asking to
be forgiven.
“Mate,” said Roberts, putting out his hand that Lease might take it,
“I’ve never had an ill thought to ye. Mishaps come to all of us that
have to do with rail-travelling; us drivers get more nor you
pointsmen. It might have happened to me to be the cause, just as
well as to you. Don’t think no more of it.”
“Say you forgive me,” urged Lease, “or I shall not know how to bear
it.”
“I forgive thee with my whole heart and soul. I’ve had a spell of it
here, Lease, waiting for death, knowing it must come to me, and
I’ve got to look for it kindly. I don’t think I’d go back to the world
now if I could. I’m going to a better. It seems just peace, and
nothing less. Shake hands, mate.”
They shook hands.
67. “I wish ye’d lift my head a bit,” Roberts said, after a while. “The
nurse she come and took away my pillow, thinking I might die
easier, I suppose: I’ve seen her do it to others. Maybe I was a’most
gone, and the sight of you woke me up again like.”
Lease sat down on the bed and put the man’s head upon his breast
in the position that seemed most easy to him; and Roberts died
there.
It was one of the worst days we had that winter. Lease had a night’s
walk home of many miles, the sleet and wind beating upon him all
the way. He was not well clad either, for his best things had been
pawned.
So that when the inquest assembled two days afterwards, Lease did
not appear at it. He was in bed with inflammation of the chest, and
Mr. Cole told the coroner that it would be dangerous to take him out
of it. Some of them called it bronchitis; but the Squire never went in
for new names, and never would.
“I tell you what it is, gentlemen,” broke in Mr. Cole, when they were
quarrelling as to whether there should be another adjournment or
not, “you’ll put off and put off, until Lease slips through your
fingers.”
“Oh, will he, though!” blustered old Massock. “He had better try at
it! We’d soon fetch him back again.”
“You’d be clever to do it,” said the doctor.
Any way, whether it was this or not, they thought better of the
adjournment, and gave their verdict. “Manslaughter against Henry
Lease.” And the coroner made out his warrant of committal to
Worcester county prison: where Lease would lie until the March
assizes.
“I am not sure but it ought to have been returned Wilful Murder,”
remarked the Squire, as he and the doctor turned out of the Bull,
and picked their way over the slush towards Crabb Lane.
68. “It might make no difference, one way or the other,” answered Mr.
Cole.
“Make no difference! What d’ye mean? Murder and manslaughter are
two separate crimes, Cole, and must be punished accordingly. You
see, Johnny, what your friend Lease has come to!”
“What I meant, Squire, was this: that I don’t much think Lease will
live to be tried at all.”
“Not live!”
“I fancy not. Unless I am much mistaken, his life will have been
claimed by its Giver long before March.”
The Squire stopped and looked at Cole. “What’s the matter with
him? This inflammation—that you went and testified to?”
“That will be the cause of death, as returned to the registrar.”
“Why, you speak just as if the man were dying now, Cole!”
“And I think he is. Lease has been very low for a long time,” added
Mr. Cole; “half clad, and not a quarter fed. But it is not that, Squire:
heart and spirit are alike broken: and when this cold caught him, he
had no stamina to withstand it; and so it has seized upon a vital
part.”
“Do you mean to tell me to my face that he will die of it?” cried the
Squire, holding on by the middle button of old Cole’s great-coat.
“Nonsense, man! you must cure him. We—we did not want him to
die, you know.”
“His life or his death, as it may be, are in the hands of One higher
than I, Squire.”
“I think I’ll go in and see him,” said the Squire, meekly.
Lease was lying on a bed close to the floor when we got to the top
of the creaky stairs, which had threatened to come down with the
69. Squire’s weight and awkwardness. He had dozed off, and little Polly,
sitting on the boards, had her head upon his arm. Her starting up
awoke Lease. I was not in the habit of seeing dying people; but the
thought struck me that Lease must be dying. His pale weary face
wore the same hue that Jake’s had worn when he was dying: if you
have not forgotten him.
“God bless me!” exclaimed the Squire.
Lease looked up with his sad eyes. He supposed they had come to
tell him officially about the verdict—which had already reached him
unofficially.
“Yes, gentlemen, I know it,” he said, trying to get up out of respect,
and falling back. “Manslaughter. I’d have been present if I could. Mr.
Cole knows I wasn’t able. I think God is taking me instead.”
“But this won’t do, you know, Lease,” said the Squire. “We don’t
want you to die.”
“Well, sir, I’m afraid I am not good for much now. And there’d be the
imprisonment, and then the sentence, so that I could not work for
my wife and children for some long years. When people come to
know how I repented of that night’s mistake, and that I have died of
it, why, they’ll perhaps befriend them and forgive me. I think God
has forgiven me: He is very merciful.”
“I’ll send you in some port wine and jelly and beef-tea—and some
blankets, Lease,” cried the Squire quickly, as if he felt flurried. “And,
Lease, poor fellow, I am sorry for having been so angry with you.”
“Thank you for all favours, sir, past and present. But for the help
from your house my little ones would have starved. God bless you
all, and forgive me! Master Johnny, God bless you.”
“You’ll rally yet, Lease; take heart,” said the Squire.
“No, sir, I don’t think so. The great dark load seems to have been
lifted off me, and light to be breaking. Don’t sob, Polly! Perhaps
70. father will be able to see you from up there as well as if he stayed
here.”
The first thing the Squire did when we got out, was to attack Mr.
Cole, telling him he ought not to have let Lease die. As he was in a
way about it, Cole excused it, quietly saying it was no fault of his.
“I should like to know what it is that has killed him, then?”
“Grief,” said Mr. Cole. “The man has died of what we call a broken
heart. Hearts don’t actually sever, you know, Squire, like a china
basin, and there’s always some ostensible malady that serves as a
reason to talk about. In this case it will be bronchitis. Which, in point
of fact, is the final end, because Lease could not rally against it. He
told me yesterday that his heart had ached so keenly since
November, it seemed to have dried up within him.”
“We are all a pack of hard-hearted sinners,” groaned the Squire, in
his repentance. “Johnny, why could you not have found them out
sooner? Where was the use of your doing it at the eleventh hour, sir,
I’d like to know?”
Harry Lease died that night. And Crabb Lane, in a fit of repentance
as sudden as the Squire’s, took the cost of the funeral off the parish
(giving some abuse in exchange) and went in a body to the grave. I
and Tod followed.
71. VII.
AUNT DEAN.
Timberdale was a small place on the other side of Crabb Ravine. Its
Rector was the Reverend Jacob Lewis. Timberdale called him Parson
Lewis when not on ceremony. He had married a widow, Mrs.
Tanerton: she had a good deal of money and two boys, and the
parish thought the new lady might be above them. But she proved
kind and good; and her boys did not ride roughshod over the land or
break down the farmers’ fences. She died in three or four years,
after a long illness.
Timberdale talked about her will, deeming it a foolish one. She left
all she possessed to the Rector, “in affectionate confidence,” as the
will worded it, “knowing he would do what was right and just by her
sons.” As Parson Lewis was an upright man with a conscience of his
own, it was supposed he would do so; but Timberdale considered
that for the boys’ sake she should have made it sure herself. It was
eight-hundred a year, good measure.
Parson Lewis had a sister, Mrs. Dean, a widow also, who lived near
Liverpool. She was not left well-off at all; could but just make a
living of it. She used to come on long visits to the Parsonage, which
saved her cupboard at home; but it was said that Mrs. Lewis did not
like her, thinking her deceitful, and they did not get on very well
together. Parson Lewis, the meekest man in the world and the most
easily led, admitted to his wife that Rebecca had always been a little
given to scheming, but he thought her true at heart.
When poor Mrs. Lewis was out of the way for good in Timberdale
churchyard, Aunt Dean had the field to herself, and came and stayed
as long as she pleased, with her child, Alice. She was a little woman
with a mild face and fair skin, and had a sort of purring manner with
72. her. Scarcely speaking above her breath, and saying “dear” and
“love” at every sentence, and caressing people to their faces, the
rule was to fall in love with her at once. The boys, Herbert and Jack,
had taken to her without question from the first, and called her
“Aunt.” Though she was of course no relation whatever to them.
Both the boys made much of Alice—a bright-eyed, pretty little girl
with brown curls and timid, winsome ways. Herbert, who was very
studious himself, helped her with her lessons: Jack, who was nearer
her age, but a few months older, took her out on expeditions,
haymaking and blackberrying and the like, and would bring her
home with her frock torn and her knees damaged. He told her that
brave little girls never cried with him; and the child would ignore the
smart of the grazed knees and show herself as brave as a martyr.
Jack was so brave and fearless himself and made so little of hurts,
that she felt a sort of shame at giving way to her natural timidity
when with him. What Alice liked best was to sit indoors by Herbert’s
side while he was at his lessons, and read story books and fairy
tales. Jack was the opposite of all that, and a regular renegade in all
kinds of study. He would have liked to pitch the books into the fire,
and did not even care for fairy tales. They came often enough to
Crabb Cot when we were there, and to our neighbours the Coneys,
with whom the Parsonage was intimate. I was only a little fellow at
the time, years younger than they were, but I remember I liked Jack
better than Herbert. As Tod did also for the matter of that. Herbert
was too clever for us, and he was to be a parson besides. He chose
the calling himself. More than once he was caught muffled in the
parson’s white surplice, preaching to Jack and Alice a sermon of his
own composition.
Aunt Dean had her plans and her plots. One great plot was always at
work. She made it into a dream, and peeped into it night and day, as
if it were a kaleidoscope of rich and many colours. Herbert Tanerton
was to marry her daughter and succeed to his mother’s property as
eldest son: Jack must go adrift, and earn his own living. She
considered it was already three parts as good as accomplished. To
73. see Herbert and Alice poring over books together side by side and to
know that they had the same tastes, was welcome to her as the
sight of gold. As to Jack, with his roving propensities, his climbing
and his daring, she thought it little matter if he came down a tree
head-foremost some day, or pitched head over heels into the depths
of Crabb Ravine, and so threw his life away. Not that she really
wished any cruel fate for the boy; but she did not care for him; and
he might be terribly in the way, when her foolish brother, the parson,
came to apportion the money. And he was foolish in some things;
soft, in fact: she often said so.
One summer day, when the fruit was ripe and the sun shining, Mr.
Lewis had gone into his study to write his next Sunday’s sermon. He
did not get on very quickly, for Aunt Dean was in there also, and it
disturbed him a little. She was of restless habits, everlastingly
dusting books, and putting things in their places without rhyme or
reason.
“Do you wish to keep out all three of these inkstands, Jacob? It is
not necessary, I should think. Shall I put one up?”
The parson took his eyes off his sermon to answer. “I don’t see that
they do any harm there, Rebecca. The children use two sometimes.
Do as you like, however.”
Mrs. Dean put one of the inkstands into the book-case, and then
looked round the room to see what else she could do. A letter
caught her eye.
“Jacob, I do believe you have never answered the note old Mullet
brought this morning! There it is on the mantelpiece.”
The parson sighed. To be interrupted in this way he took quite as a
matter of course, but it teased him a little.
“I must see the churchwardens, Rebecca, before answering it. I
want to know, you see, what would be approved of by the parish.”
74. “Just like you, Jacob,” she caressingly said. “The parish must
approve of what you approve.”
“Yes, yes,” he said hastily; “but I like to live at peace with every
one.”
He dipped his pen into the ink, and wrote a line of his sermon. The
open window looked on to the kitchen-garden. Herbert Tanerton had
his back against the walnut-tree, doing nothing. Alice sat near on a
stool, her head buried in a book that by its canvas cover Mrs. Dean
knew to be “Robinson Crusoe.” Just then Jack came out of the
raspberry bushes with a handful of fruit, which he held out to Alice.
“Robinson Crusoe” fell to the ground.
“Oh, Jack, how good they are!” said Alice. And the words came
distinctly to Aunt Dean’s ears in the still day.
“They are as good again when you pick them off the trees for
yourself,” cried Jack. “Come along and get some, Alice.”
With the taste of the raspberries in her mouth, the temptation was
not to be resisted; and she ran after Jack. Aunt Dean put her head
out at the window.
“Alice, my love, I cannot have you go amongst those raspberry
bushes; you would stain and tear your frock.”
“I’ll take care of her frock, aunt,” Jack called back.
“My darling Jack, it cannot be. That is her new muslin frock, and she
must not go where she might injure it.”
So Alice sat down again to “Robinson Crusoe,” and Jack went his
way amongst the raspberry bushes, or whither he would.
“Jacob, have you begun to think of what John is to be?” resumed
Aunt Dean, as she shut down the window.
The parson pushed his sermon from him in a sort of patient
hopelessness, and turned round on his chair. “To be?—In what way,
75. Rebecca?”
“By profession,” she answered. “I fancy it is time it was thought of.”
“Do you? I’m sure I don’t know. The other day when something was
being mentioned about it, Jack said he did not care what he was to
be, provided he had no books to trouble him.”
“I only hope you will not have trouble with him, Jacob, dear,”
observed Mrs. Dean, in ominous tones, that plainly intimated she
thought the parson would.
“He has a good heart, though he is not so studious as his brother.
Why have you shut the window, Rebecca? It is very warm.”
Mrs. Dean did not say why. Perhaps she wished to guard against the
conversation being heard. When any question not quite convenient
to answer was put to her, she had a way of passing it over in
silence; and the parson was too yielding or too inert to ask again.
“Of course, Brother Jacob, you will make Herbert the heir.”
The parson looked surprised. “Why should you suppose that,
Rebecca? I think the two boys ought to share and share alike.”
“My dear Jacob, how can you think so? Your dead wife left you in
charge, remember.”
“That’s what I do remember, Rebecca. She never gave me the
slightest hint that she should wish any difference to be made: she
was as fond of one boy as of the other.”
“Jacob, you must do your duty by the boys,” returned Mrs. Dean,
with affectionate solemnity. “Herbert must be his mother’s heir; it is
right and proper it should be so: Jack must be trained to earn his
own livelihood. Jack—dear fellow!—is, I fear, of a roving, random
disposition: were you to leave any portion of the money to him, he
would squander it in a year.”
76. “Dear me, I hope not! But as to leaving all to his brother—or even a
larger portion than to Jack—I don’t know that it would be right. A
heavy responsibility lies on me in this charge, don’t you see,
Rebecca?”
“No doubt it does. It is full eight-hundred a year. And you must be
putting something by, Jacob.”
“Not much. I draw the money yearly, but expenses seem to swallow
it up. What with the ponies kept for the boys, and the cost of the
masters from Worcester, and a hundred a year out of it that my wife
desired the poor old nurse should have till she died, there’s not a
great deal left. My living is a poor one, you know, and I like to help
the poor freely. When the boys go to the university it will be all
wanted.”
Help the poor freely!—just like him! thought Aunt Dean.
“It would be waste of time and money to send Jack to college. You
should try and get him some appointment abroad, Jacob. In India,
say.”
The clergyman opened his eyes at this, and said he should not like
to see Jack go out of his own country. Jack’s mother had not had
any opinion of foreign places. Jack himself interrupted the
conversation. He came flying up the path, put down a cabbage leaf
full of raspberries on the window-sill, and flung open the window
with his stained fingers.
“Aunt Dean, I’ve picked these for you,” he said, introducing the leaf,
his handsome face and good-natured eyes bright and sparkling.
“They’ve never been so good as they are this year. Father, just taste
them.”
Aunt Dean smiled sweetly, and called him her darling, and Mr. Lewis
tasted the raspberries.
“We were just talking of you, Jack,” cried the unsophisticated man—
and Mrs. Dean slightly knitted her brows. “Your aunt says it is time
77. you began to think of some profession.”
“What, yet awhile?” returned Jack.
“That you may be suitably educated for it, my boy.”
“I should like to be something that won’t want education,” cried
Jack, leaning his arms on the window-sill, and jumping up and
down. “I think I’d rather be a farmer than anything, father.”
The parson drew a long face. This had never entered into his
calculations.
“I fear that would not do, Jack. I should like you to choose
something higher than that; some profession by which you may rise
in the world. Herbert will go into the Church: what should you say to
the Bar?”
Jack’s jumping ceased all at once. “What, be a barrister, father? Like
those be-wigged fellows that come on circuit twice a year to
Worcester?”
“Like that, Jack.”
“But they have to study all their lives for it, father; and read up
millions of books before they can pass! I couldn’t do it; I couldn’t
indeed.”
“What do you think of being a first-class lawyer, then? I might place
you with some good firm, such as——”
“Don’t, there’s a dear father!” interrupted Jack, all the sunshine
leaving his face. “I’m afraid if I were at a desk I should kick it over
without knowing it: I must be running out and about.—Are they all
gone, Aunt Dean? Give me the leaf, and I’ll pick you some more.”
The years went on. Jack was fifteen: Herbert eighteen and at
Oxford: the advanced scholar had gone to college early. Aunt Dean
spent quite half her time at Timberdale, from Easter till autumn, and
the parson never rose up against it. She let her house during her
78. absence: it was situated on the banks of the river a little way from
Liverpool, near the place they call New Brighton now. It might have
been called New Brighton then for all I know. One family always
took the house for the summer months, glad to get out of hot
Liverpool.
As to Jack, nothing had been decided in regard to his future, for
opinions about it differed. A little Latin and a little history and a
great deal of geography (for he liked that) had been drilled into him:
and there his education ended. But he was the best climber and
walker and leaper, and withal the best-hearted young fellow that
Timberdale could boast: and he knew about land thoroughly, and
possessed a great stock of general and useful and practical
information. Many a day when some of the poorer farmers were in a
desperate hurry to get in their hay or carry their wheat on account
of threatening weather, had Jack Tanerton turned out to help, and
toiled as hard and as long as any of the labourers. He was hail-
fellow-well-met with everyone, rich and poor.
Mrs. Dean had worked on always to accomplish her ends. Slowly and
imperceptibly, but surely; Herbert must be the heir; John must shift
for himself. The parson had had this dinned into him so often now,
in her apparently frank and reasoning way, that he began to lend an
ear to it. What with his strict sense of justice, and his habit of
yielding to his sister’s views, he felt for the most part in a kind of
dilemma. But Mrs. Dean had come over this time determined to get
something settled, one way or the other.
She arrived before Easter this year. The interminable Jack (as she
often called him in her heart) was at home; Herbert was not. Jack
and Alice did not seem to miss him, but went out on their rambles
together as they did when children. The morning before Herbert was
expected, a letter came from him to his stepfather, saying he had
been invited by a fellow-student to spend the Easter holidays at his
home near London and had accepted it.
79. Mr. Lewis took it as a matter of course in his easy way; but it
disagreed with Aunt Dean. She said all manner of things to the
parson, and incited him to write for Herbert to return at once.
Herbert’s answer to this was a courteous intimation that he could
not alter his plans; and he hoped his father, on consideration, would
fail to see any good reason why he should do so. Herbert Tanerton
had a will of his own.
“Neither do I see any reason, good or bad, why he should not pay
the visit, Rebecca,” confessed the Rector. “I’m afraid it was foolish of
me to object at all. Perhaps I have not the right to deny him, either,
if I wished it. He is getting on for nineteen, and I am not his own
father.”
So Aunt Dean had to make the best and the worst of it; but she felt
as cross as two sticks.
One day when the parson was abroad on parish matters, and the
Rectory empty, she went out for a stroll, and reached the high steep
bank where the primroses and violets grew. Looking over, she saw
Jack and Alice seated below; Jack’s arm round her waist.
“You are to be my wife, you know, Alice, when we are grown up.
Mind that.”
There was no answer, but Aunt Dean certainly thought she heard the
sound of a kiss. Peeping over again, she saw Jack taking another.
“And if you don’t object to my being a farmer, Alice, I should like it
best of all. We’ll keep two jolly ponies and ride about together. Won’t
it be good?”
“I don’t object to farming, Jack. Anything you like. A successful
farmer’s home is a very pleasant one.”
Aunt Dean drew away with noiseless steps. She was too calm and
callous a woman to turn white; but she did turn angry, and
registered a vow in her heart. That presuming, upstart Jack! They
80. were only two little fools, it’s true; no better than children; but the
nonsense must be stopped in time.
Herbert went back to Oxford without coming home. Alice, to her
own infinite astonishment, was despatched to school until
midsummer. The parson and his sister and Jack were left alone; and
Aunt Dean, with her soft smooth manner and her false expressions
of endearment, ruled all things; her brother’s better nature amidst
the rest.
Jack was asked what he would be. A farmer, he answered. But Aunt
Dean had somehow caught up the most bitter notions possible
against farming in general; and Mr. Lewis, not much liking the thing
himself, and yielding to the undercurrent ever gently flowing, told
Jack he must fix on something else.
“There’s nothing I shall do so well at as farming, father,”
remonstrated Jack. “You can put me for three or four years to some
good agriculturist, and I’ll be bound at the end of the time I should
be fit to manage the largest and best farm in the country. Why, I am
a better farmer now than some of them are.”
“Jack, my boy, you must not be self-willed. I cannot let you be a
farmer.”
“Then send me to sea, father, and make a sailor of me,” returned
Jack, with undisturbed good humour.
But this startled the parson. He liked Jack, and he had a horror of
the sea. “Not that, Jack, my boy. Anything but that.”
“I’m not sure but I should like the sea better than farming,” went on
Jack, the idea full in his head. “Aunt Dean lent me ‘Peter Simple’ one
day. I know I should make a first-rate sailor.”
“Jack, don’t talk so. Your poor mother would not have liked it, and I
don’t like it; and I shall never let you go.”
“Some fellows run away to sea,” said Jack, laughing.
81. The parson felt as though a bucket of cold water had been thrown
down his back. Did Jack mean that as a threat?
“John,” said he, in as solemn a way as he had ever spoken,
“disobedience to parents sometimes brings a curse with it. You must
promise me that you will never go to sea.”
“I’ll not promise that, off-hand,” said Jack. “But I will promise never
to go without your consent. Think it well over, father; there’s no
hurry.”
It was on the tip of Mr. Lewis’s tongue to withdraw his objection to
the farming scheme then and there: in comparison with the other it
looked quite fair and bright. But he thought he might compromise
his judgment to yield thus instantly: and, as easy Jack said, there
was no hurry.
So Jack went rushing out of doors again to the uttermost bounds of
the parish, and the parson was left to Aunt Dean. When he told her
he meant to let Jack be a farmer, she laughed till the tears came into
her eyes, and begged him to leave matters to her. She knew how to
manage boys, without appearing directly to cross them: there was
this kind of trouble with most boys, she had observed, before they
settled satisfactorily in life, but it all came right in the end.
So the parson said no more about farming: but Jack talked a great
deal about the sea. Mr. Lewis went over in his gig to Worcester, and
bought a book he had heard of, “Two Years before the Mast.” He
wrote Jack’s name in it and gave it him, hoping its contents might
serve to sicken him of the sea.
The next morning the book was missing. Jack looked high and low
for it, but it was gone. He had left it on the sitting-room table when
he went up to bed, and it mysteriously disappeared during the night.
The servants had not seen it, and declared it was not on the table in
the morning.
82. “It could not—I suppose—have been the cat,” observed Aunt Dean,
in a doubtful manner, her eyes full of wonder as to where the book
could have got to. “I have heard of cats doing strange things.”
“I don’t think the cat would make away with a book of that size,
Rebecca,” said the parson. And if he had not been the least
suspicious parson in all the Worcester Diocese, he might have asked
his sister whether she had been the cat, and secured the book lest it
should dissipate Jack’s fancy for the sea.
The next thing she did was to carry Jack off to Liverpool. The parson
objected at first: Liverpool was a seaport town, and might put Jack
more in mind of the sea than ever. Aunt Dean replied that she meant
him to see the worst sides of sea life, the dirty boats in the Mersey,
the wretchedness of the crews, and the real discomfort and misery
of a sailor’s existence. That would cure him, she said: what he had
in his head now was the romance picked up from books. The parson
thought there was reason in this, and yielded. He was dreadfully
anxious about Jack.
She went straight to her house near New Brighton, Jack with her,
and a substantial sum in her pocket from the Rector to pay for Jack’s
keep. The old servant, Peggy, who took care of it, was thunderstruck
to see her mistress come in. It was not yet occupied by the Liverpool
people, and Mrs. Dean sent them word they could not have it this
year: at least not for the present. While she put matters straight, she
supplied Jack with all Captain Marryat’s novels to read. The house
looked on the river, and Jack would watch the fine vessels starting
on their long voyages, their white sails trim and fair in the sunshine,
or hear the joyous shouts from the sailors of a homeward-bound
ship as Liverpool hove in view; and he grew to think there was no
sight so pleasant to the eye as these wonderful ships; no fate so
desirable as to sail in them.
But Aunt Dean had changed her tactics. Instead of sending Jack on
to the dirtiest and worst managed boats in the docks, where the
living was hard and the sailors were discontented, she allowed him
83. to roam at will on the finest ships, and make acquaintance with their
enthusiastic young officers, especially with those who were going to
sea for the first time with just such notions as Jack’s. Before
Midsummer came, Jack Tanerton had grown to think that he could
never be happy on land.
There was a new ship just launched, the Rose of Delhi; a
magnificent vessel. Jack took rare interest in her. He was for ever on
board; was for ever saying to her owners—friends of Aunt Dean’s, to
whom she had introduced him—how much he should like to sail in
her. The owners thought it would be an advantageous thing to get
so active, open, and ready a lad into their service, although he was
somewhat old for entering, and they offered to article him for four
years, as “midshipman” on the Rose of Delhi. Jack went home with
his tale, his eyes glowing; and Aunt Dean neither checked him nor
helped him.
Not then. Later, when the ship was all but ready to sail, she told Jack
she washed her hands of it, and recommended him to write and ask
his stepfather whether he might sail in her, or not.
Now Jack was no letter writer; neither, truth to tell, was the parson.
He had not once written home; but had contented himself with
sending affectionate messages in Aunt Dean’s letters. Consequently,
Mr. Lewis only knew what Aunt Dean had chosen to tell him, and
had no idea that Jack was getting the real sea fever upon him. But
at her suggestion Jack sat down now and wrote a long letter.
Its purport was this. That he was longing and hoping to go to sea;
was sure he should never like anything else in the world so well;
that the Rose of Delhi, Captain Druce, was the most magnificent ship
ever launched; that the owners bore the best character in Liverpool
for liberality, and Captain Druce for kindness to his middies; and that
he hoped, oh he hoped, his father would let him go; but that if he
still refused, he (Jack) would do his best to be content to stay on
shore, for he did not forget his promise of never sailing without his
consent.
84. “Would you like to see the letter, Aunt Dean, before I close it?” he
asked.
Aunt Dean, who had been sitting by, took the letter, and privately
thought it was as good a letter and as much to the purpose as the
best scribe in the land could have written. She disliked it, for all that.
“Jack, dear, I think you had better put a postscript,” she said. “Your
father detests writing, as you know. Tell him that if he consents he
need not write any answer: you will know what it means—that you
may go—and it will save him trouble.”
“But, Aunt Dean, I should like him to wish me good-bye and God
speed.”
“He will be sure to do the one in his heart and the other in his
prayers, my boy. Write your postscript.”
Jack did as he was bid: he was as docile as his stepfather. Exactly as
Mrs. Dean suggested, wrote he: and he added that if no answer
arrived within two posts, he should take it for granted that he was to
go, and should see about his outfit. There was no time to lose, for
the ship would sail in three or four days.
“I will post it for you, Jack,” she said, when it was ready. “I am going
out.”
“Thank you, Aunt Dean, but I can post it myself. I’d rather: and then
I shall know it’s off. Oh, shan’t I be on thorns till the time for an
answer comes and goes!”
He snatched his cap and vaulted off with the letter before he could
be stopped. Aunt Dean had a curious look on her face, and sat biting
her lips. She had not intended the letter to go.
The first post that could possibly bring an answer brought one. Jack
was not at home. Aunt Dean had sent him out on an early
commission, watched for the postman, and hastened to the door
herself to receive what he might bring. He brought two letters—as it
85. chanced. One from the Rector of Timberdale; one from Alice Dean.
Mrs. Dean locked up the one in her private drawer upstairs: the
other she left on the breakfast-table.
“Peggy says the postman has been here, aunt!” cried the boy, all
excitement, as he ran in.
“Yes, dear. He brought a letter from Alice.”
“And nothing from Timberdale?”
“Well, I don’t know that you could quite expect it by this post, Jack.
Your father might like to take a little time for consideration. You may
read Alice’s letter, my boy: she comes home this day week for the
summer holidays.”
“Not till this day week!” cried Jack, frightfully disappointed. “Why, I
shall have sailed then, if I go, Aunt Dean! I shall not see her.”
“Well, dear, you will see her when you come home again.”
Aunt Dean had no more commissions for Jack after that, and each
time the postman was expected, he placed himself outside the door
to wait for him. The man brought no other letter. The reasonable
time for an answer went by, and none came.
“Aunt Dean, I suppose I may get my outfit now,” said Jack, only half
satisfied. “But I wish I had told him to write in any case: just a line.”
“According to what you said, you know, Jack, silence must be taken
for consent.”
“Yes, I know. I’d rather have had a word, though, and made certain.
I wish there was time for me just to run over to Timberdale and see
him!”
“But there’s not, Jack, more’s the pity: you would lose the ship. Get
a piece of paper and make out a list of the articles the second mate
told you you would want.”
86. The Rose of Delhi sailed out of port for Calcutta, and John Tanerton
with her, having signed articles to serve in her for four years. The
night before his departure he wrote a short letter of farewell to his
stepfather, thanking him for his tacit consent, and promising to do
his best to get on, concluding it with love to himself and to Herbert,
and to the Rectory servants. Which letter somehow got put into Aunt
Dean’s kitchen fire, and never reached Timberdale.
Aunt Dean watched the Rose of Delhi sail by; Jack, in his bran-new
uniform, waving his last farewell to her with his gold-banded cap.
The sigh of relief she heaved when the fine vessel was out of sight
seemed to do her good. Then she bolted herself into her chamber,
and opened Mr. Lewis’s letter, which had lain untouched till then. As
she expected, it contained a positive interdiction, written half sternly,
half lovingly, for John to sail in the Rose of Delhi, or to think more of
the sea. Moreover, it commanded him to come home at once, and it
contained a promise that he should be placed to learn the farming
without delay. Aunt Dean tripped down to Peggy’s fire and burnt that
too.
There was a dreadful fuss when Jack’s departure became known at
Timberdale. It fell upon the parson like a thunderbolt. He came
striding through the ravine to Crabb Cot, and actually burst out
crying while telling the news to the Squire. He feared he had failed
somehow in bringing John up, he said, or he never would have
repaid him with this base disobedience and ingratitude. For, you see,
the poor man thought Jack had received his letter, and gone off in
defiance of it. The Squire agreed with him that Jack deserved the
cat-o’-nine tails, as did all other boys who traitorously decamped to
sea.
Before the hay was all in, Aunt Dean was back at Timberdale,
bringing Alice with her and the bills for the outfit. She let the parson
think what he would about Jack, ignoring all knowledge of the letter,
and affecting to believe that Jack could not have had it. But the
parson argued that Jack must have had it, and did have it, or it
would have come back to him. The only one to say a good word for
87. Jack was Alice. She persisted in an opinion that Jack could not be
either disobedient or ungrateful, and that there must have been
some strange mistake somewhere.
Aunt Dean’s work was not all done. She took the poor parson under
her wing, and proved to him that he had no resource now but to
disinherit Jack, and made Herbert the heir. To leave money to Jack
would be wanton waste, she urged, for he would be sure to
squander it: better bequeath all to Herbert, who would of course
look after his brother in later life, and help him if he needed help. So
Mr. Hill, one of the Worcester solicitors, was sent for to Timberdale
to receive instructions for making the parson’s will in Herbert’s
favour, and to cut Jack off with a shilling.
That night, after Mr. Hill had gone back again, was one of the worst
the parson had ever spent. He was a just man and a kind one, and
he felt racked with fear lest he had taken too severe a measure, and
one that his late wife, the true owner of the money and John’s
mother, would never have sanctioned. His bed was fevered, his
pillow a torment; up he got, and walked the room in his night-shirt.
“My Lord and God knoweth that I would do what is right,” he
groaned. “I am sorely troubled. Youth is vain and desperately
thoughtless; perhaps the boy, in his love of adventure, never looked
at the step in the light of ingratitude. I cannot cut him quite off; I
should never again find peace of mind if I did it. He shall have a
little; and perhaps if he grows into a steady fellow and comes back
what he ought to be, I may alter the will later and leave them equal
inheritors.”
The next day the parson wrote privately to Mr. Hill, saying he had
reconsidered his determination and would let Jack inherit to the
extent of a hundred and fifty pounds a year.
Herbert came home for the long vacation; and he and Alice were
together as they had been before that upstart Jack stepped in. They
often came to the Squire’s and oftener to the Coneys’. Grace Coney,
88. a niece of old Coney, had come to live at the farm; she was a nice
girl, and she and Alice liked each other. You might see them with
Herbert strolling about the fields any hour in the day. At home Alice
and Herbert seemed never to care to separate. Mrs. Dean watched
them quietly, and thought how beautifully her plans had worked.
Aunt Dean did not go home till October. After she left, the parson
had a stroke of paralysis. Charles Ashton, then just ordained to
priest’s orders, took the duty. Mrs. Dean came back again for
Christmas. As if she would let Alice stay away from the Parsonage
when Herbert was at home!
The Rose of Delhi did not come back for nearly two years. She was
what is called a free ship, and took charters for any place she could
make money by. One day Alice Dean was leaning out of the windows
of her mother’s house, gazing wistfully on the sparkling sea, when a
grand and stately vessel came sailing homewards, and some brown-
faced young fellow on the quarter deck set on to swing his cap
violently by way of hailing her. She looked to the flag which
happened to be flying, and read the name there, “The Rose of
Delhi.” It must be Jack who was saluting. Alice burst into tears of
emotion.
He came up from the docks the same day. A great, brown,
handsome fellow with the old single-hearted, open manners. And he
clasped Alice in his arms and kissed her ever so many times before
she could get free. Being a grown-up young lady now, she did not
approve of unceremonious kissing, and told Jack so. Aunt Dean was
not present, or she might have told him so more to the purpose.
Jack had given satisfaction, and was getting on. He told Alice
privately that he did not like the sea so much as he anticipated, and
could not believe how any other fellow did like it; but as he had
chosen it as his calling, he meant to stand by it. He went to
Timberdale, in spite of Aunt Dean’s advice and efforts to keep him
away. Herbert was absent, she said; the Rector ill and childish. Jack
found it all too true. Mr. Lewis’s mind had failed and his health was
89. breaking. He knew Jack and was very affectionate with him, but
seemed not to remember anything of the past. So never a word did
Jack hear of his own disobedience, or of any missing letters.
One person alone questioned him; and that was Alice. It was after
he got back from Timberdale. She asked him to tell her the history
of his sailing in the Rose of Delhi, and he gave it in detail, without
reserve. When he spoke of the postscript that Aunt Dean had bade
him add to his letter, arranging that silence should be taken for
consent, and that as no answer had come, he of course had so
taken it, the girl turned sick and faint. She saw the treachery that
had been at work and where it had lain; but for her mother’s sake
she hushed it up and let the matter pass. Alice had not lived with
her mother so many years without detecting her propensity for
deceit.
Some years passed by. Jack got on well. He served as third mate on
the Rose of Delhi long before he could pass, by law, for second. He
was made second mate as soon as he had passed for it. The Rose of
Delhi came in and went out, and Jack stayed by her, and passed for
first mate in course of time. He was not sent back in any of his
examinations, as most young sailors are, and the board once went
the length of complimenting him on his answers. The fact was, Jack
held to his word of doing his best; he got into no mischief and was
the smartest sailor afloat. He was in consequence a favourite with
the owners, and Captain Druce took pains with him and brought him
on in seamanship and navigation, and showed him how to take
observations, and all the rest of it. There’s no end of difference in
merchant-captains in this respect: some teach their junior officers
nothing. Jack finally passed triumphantly for master, and hoped his
time would come to receive a command. Meanwhile he went out
again as first mate on the Rose of Delhi.
One spring morning there came news to Mrs. Dean from Timberdale.
The Rector had had another stroke and was thought to be near his
end. She started off at once, with Alice. Charles Ashton had had a
living given to him; and Herbert Tanerton was now his stepfather’s
90. Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com