|
3 | 3 | import io.micronaut.http.HttpResponse; |
4 | 4 | import io.micronaut.http.annotation.Controller; |
5 | 5 | import io.micronaut.http.annotation.Get; |
6 | | -import io.micronaut.http.client.BlockingHttpClient; |
7 | | -import io.micronaut.http.client.DefaultHttpClientConfiguration; |
8 | 6 | import io.micronaut.http.client.HttpClient; |
9 | | -import io.micronaut.http.client.HttpClientConfiguration; |
10 | 7 |
|
11 | 8 | import java.net.URL; |
12 | 9 |
|
|
24 | 21 | @Controller("/command") |
25 | 22 | public class ViewTraces { |
26 | 23 |
|
27 | | - private final HttpClientConfiguration config = new DefaultHttpClientConfiguration(); |
28 | | - |
29 | | - public ViewTraces() { |
30 | | - config.setExceptionOnErrorStatus(false); |
31 | | - } |
32 | | - |
33 | 24 | /** |
34 | 25 | * Execute the `View Traces` command with your caret anywhere between lines 31 and 38 to see the traces for |
35 | 26 | * the endpoint below. Executing this command will open a list of traces for the given endpoint. Clicking on a |
36 | 27 | * trace will open the trace details. |
37 | 28 | */ |
38 | 29 | @Get("/view-traces") |
39 | 30 | public HttpResponse<Void> entryEndpoint() throws Exception { |
40 | | - try (HttpClient client = HttpClient.create(new URL("http://localhost:8080"), config)) { |
41 | | - try (BlockingHttpClient blocking = client.toBlocking()) { |
42 | | - blocking.retrieve("/command/view-traces/exit"); |
43 | | - } |
| 31 | + try (HttpClient client = HttpClient.create(new URL("http://localhost:8080"))) { |
| 32 | + client.toBlocking().retrieve("/command/view-traces/exit"); |
44 | 33 | } |
45 | 34 | return HttpResponse.ok(); |
46 | 35 | } |
|
0 commit comments