This file contains 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
@GetMapping("/discounts") | |
@HystrixCommand(fallbackMethod = "getDefaultDiscount", commandKey = "getDefaultDiscount") | |
public ResponseEntity<WSDiscount> getProductDiscount(@RequestParam("id") String id) { | |
ResponseEntity<WSDiscount> responseEntity = | |
baseRestOutboundProcessor.get("https://discount-service.com?id=" + id, null, WSDiscount.class, new HashMap<>()); | |
return ResponseEntity.ok(responseEntity.getBody()); | |
} | |
public ResponseEntity<WSDiscount> getDefaultDiscount(String id) { | |
WSDiscount discount = new WSDiscount(); |
This file contains 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
package com.minikube.sample.rest.controller; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import lombok.Getter; | |
import lombok.Setter; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.GetMapping; |
This file contains 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
C:\Users\eresh.gorantla\apps\minikube-sample (master -> origin) | |
λ mvn clean package -DskipTests=true | |
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] ----------------< com.minikube.sample:minikube-sample >----------------- | |
[INFO] Building minikube-sample 0.0.1-SNAPSHOT | |
[INFO] --------------------------------[ jar ]--------------------------------- | |
[INFO] | |
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ minikube-sample --- | |
[INFO] Deleting C:\Users\eresh.gorantla\apps\minikube-sample\target |
This file contains 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
FROM openjdk:8-jdk-alpine | |
VOLUME /c/Users/eresh.gorantla/ | |
COPY ./target/minikube-sample-0.0.1-SNAPSHOT.jar app.jar | |
ENV JAVA_OPTS="" | |
ENTRYPOINT exec java -jar app.jar --debug |
This file contains 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: minikube-sample | |
spec: | |
selector: | |
matchLabels: | |
app: minikube-sample | |
replicas: 1 |
This file contains 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
C:\Users\eresh.gorantla\apps\minikube-sample (master -> origin) | |
λ mvn clean package -DskipTests=true | |
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] ----------------< com.minikube.sample:minikube-sample >----------------- | |
[INFO] Building minikube-sample 0.0.1-SNAPSHOT | |
[INFO] --------------------------------[ jar ]--------------------------------- | |
[INFO] | |
[INFO] - |
This file contains 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
package com.eresh.spring.rest; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import org.springframework.web.client.RestTemplate; | |
/** |
This file contains 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
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: discovery-client | |
spec: | |
selector: | |
app: discovery-client | |
ports: | |
- protocol: TCP | |
port: 8081 |
OlderNewer