Delomboking

This commit is contained in:
Marcin Grzejszczak
2016-02-10 19:09:20 +01:00
parent 8f5f553376
commit ee8d7a54c7
68 changed files with 687 additions and 391 deletions

View File

@@ -16,14 +16,13 @@
package sample;
import lombok.SneakyThrows;
import java.util.Random;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import java.util.Random;
/**
* @author Spencer Gibb
* @author Dave Syer
@@ -36,15 +35,13 @@ public class SampleController {
@Autowired
private Random random;
@SneakyThrows
@RequestMapping("/")
public String hi() {
public String hi() throws InterruptedException {
Thread.sleep(this.random.nextInt(1000));
String s = this.restTemplate.getForObject("http://zipkin/hi2", String.class);
return "hi/" + s;
}
@SneakyThrows
@RequestMapping("/call")
public String traced() {
String s = this.restTemplate.getForObject("http://zipkin/call", String.class);