Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Table of Contents

1. [zuul] Zuul 과 Eureka 디펜던시 추가 (build.gradle)

Code Block
titlebuild.gradle
linenumberstrue
compile('org.springframework.cloud:spring-cloud-starter-netflix-zuul') 
compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client') 
compile('org.springframework.retry:spring-retry:1.2.2.RELEASE')

2. [zuul] application.yml

Enable Zuul, Eureka
Code Block
languageyml
titleapplication.yml
linenumberstrue
server:
  port: 8765

zuul:
  routes:
    product:
      path: /products/**
      serviceId: product
      stripPrefix: false
    display:
      path: /displays/**
      serviceId: display
      stripPrefix: false

eureka:
  instance:
    non-secure-port: ${server.port}
    prefer-ip-address: true
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/

3. [zuul] ZuulApplication

Code Block
languagejava
titleMainClassZuulApplication
linenumberstrue
@EnableZuulProxy
@EnableDiscoveryClient
@SpringBootApplication
public class ZuulApplication {

    public static void main(String[] args) {
        SpringApplication.run(ZuulApplication.class, 
@EnableDiscoveryClientargs);
    }
}