Skip to content

Commit 874878c

Browse files
committed
Log for testing Load balancing feature of Zuul
1 parent 63a696c commit 874878c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

zuul/customer-service/src/main/java/com/fd/sample/customer/controller/CustomerController.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.fd.sample.customer.controller;
22

33
import com.fd.sample.customer.model.Customer;
4+
import lombok.extern.slf4j.Slf4j;
5+
import org.springframework.beans.factory.annotation.Value;
46
import org.springframework.web.bind.annotation.GetMapping;
57
import org.springframework.web.bind.annotation.RequestMapping;
68
import org.springframework.web.bind.annotation.RestController;
@@ -13,12 +15,18 @@
1315
* @author furkand
1416
* 10/8/2018 9:59 AM
1517
*/
18+
@Slf4j
1619
@RestController
1720
@RequestMapping("/api/customers")
1821
public class CustomerController {
1922

23+
@Value("${server.port}")
24+
private int port;
25+
2026
@GetMapping
2127
public List<Customer> customerList() {
28+
log.info("A request is received: " + port);
29+
2230
Customer c1 = Customer.builder()
2331
.id("1").name("john doe").company("acme").birthdate(LocalDate.now().minusYears(28)).build();
2432
Customer c2 = Customer.builder()

0 commit comments

Comments
 (0)