This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./jboss-cli.sh -c "/subsystem=naming/binding=java\:\/greeting.name:add(binding-type=simple,value=Backbase)" | |
{"outcome" => "success"} | |
$ ./jboss-cli.sh -c "reload" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GREETING_NAME="Dexter" java -jar target/configuration-with-spring-boot-0.0.1-SNAPSHOT.war |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -Dgreeting.name="Heisenberg" -jar target/configuration-with-spring-boot-0.0.1-SNAPSHOT.war |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar target/configuration-with-spring-boot-0.0.1-SNAPSHOT.war --greeting.name=Zoltan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/altfatterz/configuration-with-spring-boot | |
cd configuration-with-spring-boot | |
mvn clean package | |
java -jar target/configuration-with-spring-boot-0.0.1-SNAPSHOT.war |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class GreetingService { | |
private static final Logger LOGGER = LoggerFactory.getLogger(GreetingService.class); | |
@Value("${greeting.name:World}") | |
private String name; | |
public String greet() { | |
if (LOGGER.isDebugEnabled()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
localhost:~ zoltan$ curl localhost:8082/lookup?name=google | |
{"name":"Google","website":"www.google.com","lookupTime":132}localhost:~ zoltan$ curl localhost:8081/lookup?name=google | |
{"name":"Google","website":"www.google.com","lookupTime":3}localhost:~ zoltan$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
localhost:~ zoltan$ curl localhost:8080/lookup?name=backbase | |
{"name":"Backbase","website":"http://www.backbase.com/","lookupTime":572}localhost:~ zoltan$ curl localhost:8080/lookup?nam=backbase | |
{"name":"Backbase","website":"http://www.backbase.com/","lookupTime":1}localhost:~ zoltan$ curl localhost:8080/lookup?name=backbase | |
{"name":"Backbase","website":"http://www.backbase.com/","lookupTime":0}localhost:~ zoltan$ curl localhost:8080/lookup?name=backbase | |
{"name":"Backbase","website":"http://www.backbase.com/","lookupTime":1}localhost:~ zoltan$ curl localhost:8080/lookup?name=backbase | |
{"name":"Backbase","website":"http://www.backbase.com/","lookupTime":0}localhost:~ zoltan$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar target/spring-caching-1.0-SNAPSHOT.jar --spring.profiles.active=redis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar target/spring-caching-1.0-SNAPSHOT.jar --spring.profiles.active=hazelcast --server.port=8081 | |
java -jar target/spring-caching-1.0-SNAPSHOT.jar --spring.profiles.active=hazelcast --server.port=8082 |