Book Image

Spring Boot Cookbook

By : Alex Antonov
Book Image

Spring Boot Cookbook

By: Alex Antonov

Overview of this book

Table of Contents (15 chapters)
Spring Boot Cookbook
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

Management of Spring Boot via CRaSH and writing custom remote shell commands


Some of you are probably reminiscing about the good old days where all the administration was done via SSH directly on the machine, where one has complete flexibility and control, or even using a Telnet to connect to a management port and apply whatever the changes needed directly to a running application. For you, Spring Boot provides integration with the CRaSH Java Shell.

For this recipe, we will use the health indicator and management endpoint, which we created earlier in this chapter. We will expose the same capabilities via the SSH and Telnet console access.

How to do it…

  1. The first step to get CRaSH to work is add the necessary dependency starters to our build.gradle file, as follows:

    dependencies {
        ...
        compile("org.springframework.boot:spring-boot-starter-actuator")
        compile("org.springframework.boot:spring-boot-starter-remote-shell")
        compile("org.crashub:crash.connectors.telnet:1.3.1")
        compile...