Although version 10 is a non-LTS release, they've packaged it as openjdk-11-jdk until OpenJDK 11 goes GA. The Ubuntu Foundation Team made an SRU exception for OpenJDK. After having it installed on Ubuntu 18.04 (Bionic Beaver), which comes with a package named openjdk-11-jdk, to my surprise, that was still part of an earlier version (Java 10). As this is the first LTS release after version 8, it's been a long time coming. The prefix config-consumer-service is passed to the Config Service and used as a key to look up the configuration specific to the Config Consumer Service.OpenJDK 11 was released on September 25, 2018. The annotation along with the configuration in bootstrap.yml, tell Spring boot to source connectionTimeoutMillis and readTimeoutMillis from the Config Service, on startup. class ConfigConsumerController ]", timeoutConfig) Ĭonfiguration contains the two config values that we exposed on the REST endpoint. These values are sourced from the Config Service and injected into the controller via Configuration. It returns a TimoutConfig object with 2 values, connectionTimeoutMillis and readTimeoutMillis. To consume config from the Confg Service we’ll need spring-cloud-starter-config in the POM. The REST endpoint will return the config values loaded from the Configuration Service, allowing us to do a simple end to end test. On startup the Config Consumer Service will call the Config Service to retrieve its configuration. The Config Consumer service is a vanilla Spring Boot app with a simple REST endpoint. Next we’ll create a consumer service that will pull its configuration from Config Service on startup. Now that we’ve defined the Config Service, its time to put it to work. FROM openjdk:11-jre-slim-busterĬOPY /target/config-server-0.0.1-SNAPSHOT.jar /app/ĮNTRYPOINT I’ve also installed cURL as it can be handy for debugging connectivity issues between containers. It uses a JRE 11 base image, adds the packaged JAR and runs the JAR on startup via the command in ENRTYPOINT. The Dockerfile below is pretty straight forward. Now that we’ve defined the Config Service, the next step is to containerise it with Docker. We’re only really interested in the health endpoint as we’ll need it later when deploying to the Kubernetes cluster. Lines 14 to 21 enable the actuator endpoints. These three attributes combined, will tell the Config Service to serve up configuration from
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |