Skip to content

Instantly share code, notes, and snippets.

View altfatterz's full-sized avatar
👨‍💻
Playing

Zoltan Altfatter altfatterz

👨‍💻
Playing
View GitHub Profile
$ ./jboss-cli.sh -c "/subsystem=naming/binding=java\:\/greeting.name:add(binding-type=simple,value=Backbase)"
{"outcome" => "success"}
$ ./jboss-cli.sh -c "reload"
GREETING_NAME="Dexter" java -jar target/configuration-with-spring-boot-0.0.1-SNAPSHOT.war
java -Dgreeting.name="Heisenberg" -jar target/configuration-with-spring-boot-0.0.1-SNAPSHOT.war
java -jar target/configuration-with-spring-boot-0.0.1-SNAPSHOT.war --greeting.name=Zoltan
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
@altfatterz
altfatterz / GreetingService.java
Created October 12, 2014 20:55
GreetingService
@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()) {
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$
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$
java -jar target/spring-caching-1.0-SNAPSHOT.jar --spring.profiles.active=redis
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