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
@RequestMapping(method = RequestMethod.GET) | |
public @ResponseBody Page lookup(@RequestParam String name) { | |
long start = System.currentTimeMillis(); | |
Page page = facebook.findPage(name); | |
long elapsed = System.currentTimeMillis() - start; | |
page.setLookupTime(elapsed); | |
return page; | |
} |
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
mvn clean install | |
java -jar target/spring-caching-1.0-SNAPSHOT.jar |
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":90}localhost:~ zoltan$ curl localhost:8080/lookup?name=backbase | |
{"name":"Backbase","website":"http://www.backbase.com/","lookupTime":62}localhost:~ zoltan$ curl localhost:8080/lookup?name=backbase | |
{"name":"Backbase","website":"http://www.backbase.com/","lookupTime":65}localhost:~ zoltan$ curl localhost:8080/lookup?name=backbase | |
{"name":"Backbase","website":"http://www.backbase.com/","lookupTime":70}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=ehcache |
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 |
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
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
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
@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
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 |