• Stars
    star
    371
  • Rank 115,103 (Top 3 %)
  • Language
    Java
  • Created over 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Config Server Sample

NOTE: This project requires rabbitmq running on localhost.

Run this project as a Spring Boot app, e.g. import into IDE and run main method, or use Maven:

$ ./mvnw spring-boot:run

or

$ ./mvnw package
$ java -jar target/*.jar

It will start up on port 8888 and serve configuration data from "https://github.com/spring-cloud-samples/config-repo":

Pre-requisites

You need to be running rabbitmq locally (there is a docker-compose.yml if you would like to use that). This is to support broadcast of config changes to client apps via Spring Cloud Stream. If you want to play and don't need that feature just comment out the monitor and rabbitmq dependencies.

Resources

Path Description
/{app}/{profile} Configuration data for app in Spring profile (comma-separated).
/{app}/{profile}/{label} Add a git label
/{app}/{profile}{label}/{path} An environment-specific plain text config file (at "path")

Security

The server is not secure by default. You can add HTTP Basic authentication by including an extra dependency on Spring Security (e.g. via spring-boot-starter-security). The user name is "user" and the password is printed on the console on startup (standard Spring Boot approach), e.g.

2014-10-23 08:55:01.579  INFO 8185 --- [           main] b.a.s.AuthenticationManagerConfiguration :

Using default security password: 83805c57-8c76-4940-ae17-299359888177


There is also a password stored in a keystore in the jar file if you want to use that for a more realistic simulation of a real system. To unlock the password you need the full strength JCE extensions (download from Oracle and unpack the zip then copy the jar files to <JAVA_HOME>/jre/lib/security), and the keystore password ("foobar" stored in plain text in this README for the purposes of a demo, but in a real system you would keep it secret and only expose via environment variables). The password is bound to the app from the Spring environment key keystore.password (so an OS environment variable KEYSTORE_PASSWORD works). E.g.

$ KEYSTORE_PASSWORD=foobar java -jar target/*.jar

More Repositories

1

eureka

Java
500
star
2

customers-stores

Two microservices for customers and stores
Java
431
star
3

spring-cloud-contract-samples

Samples for Spring Cloud Contract project
Java
379
star
4

spring-cloud-gateway-sample

Sample Spring Cloud Gateway Application
Java
360
star
5

brewery

Brewing beer with Spring Cloud has never been that easy...
Java
353
star
6

feign-eureka

Example of using feign with eureka
Java
236
star
7

config-repo

Configuration files for the server sample
138
star
8

bookstore-service-broker

Sample application for Spring Cloud Open Service Broker
Java
72
star
9

spring-cloud-circuitbreaker-demo

Samples demonstrating how to using Spring Cloud Circuitbreaker
Java
64
star
10

spring-cloud-sleuth-samples

Contains isolated samples of Spring Cloud Sleuth
Java
23
star
11

spring-cloud-contract-nodejs

Spring Cloud Contract with Node JS application
Shell
22
star
12

spring-cloud-config-vault

Sample application demonstrating how to use Hashicorp Vault as a backend for a Spring Cloud Config server
Java
16
star
13

svn-config-server

Sample Config Server and Config Client. The Config Server is configured to use Subversion rather than git
Java
16
star
14

spring-cloud-app-broker-samples

Sample apps for https://github.com/spring-cloud/spring-cloud-app-broker
Java
8
star
15

spring-cloud-square-retrofit-web

Demo project for Spring Cloud Square Retrofit Web
Java
3
star
16

sleuth-issues

Samples for Sleuth that replicate issues
Java
2
star
17

spring-cloud-function-samples

1
star
18

spring-cloud-square-retrofit-webclient

Java
1
star
19

spring-cloud-intro-demo-config

Centralised Configuration for Spring Cloud Intro Demo
1
star
20

spring-cloud-contract-nodejs-external-contracts

External contracts for the Spring Cloud Contract NodeJS sample
Java
1
star