Tweaking things in production
An application isn’t really in production until we need to start tweaking it, fiddling with it, and making adjustments after release.
This is the very nature of operations. And the various members of the Spring team are no strangers to the world of production.
There are multiple things we can tune and adjust after being handed either an uber JAR or a container. Assuming we have an uber JAR built out of this chapter’s code, we can easily type something like this:
% java -jar target/ch7-0.0.1-SNAPSHOT.jar
This would launch the app with all its default settings, including the standard servlet port of 8080
.
But what if we needed it to run next to another Spring Boot web application we just installed yesterday? That suggests we’d need it to listen on a different port. Say no more. All we need do is run a slightly different command, like this:
% SERVER_PORT=9000 java -jar target/ch7-0.0.1-SNAPSHOT.jar … 2022-11...