<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency>
package com.lidihuo.microservices.currencyconversionservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableFeignClients("com.lidihuo.microservices.currencyconversionservice") @EnableDiscoveryClient public class CurrencyConversionServiceApplication { public static void main(String[] args) { SpringApplication.run(CurrencyConversionServiceApplication.class, args); } }
spring.application.name=currency-conversion-service server.port=8100 eureka.client.service-url.default-zone=http://localhost:8761/eureka currency-exchange-service.ribbon.listOfServers=http://localhost:8000, http://localhost:8001
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency>
package com.lidihuo.microservices.currencyexchangeservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @SpringBootApplication @EnableDiscoveryClient public class CurrencyExchangeServiceApplication { public static void main(String[] args) { SpringApplication.run(CurrencyExchangeServiceApplication.class, args); } }
spring.application.name=currency-exchange-service server.port=8000 spring.jpa.show-sql=true spring.h2.console.enabled=true spring.datasource.platform=h2 spring.datasource.url=jdbc:h2:mem:lidihuo eureka.client.service-url.default-zone=http://localhost:8761/eureka