diff --git a/feign-eager-instantiation/pom.xml b/feign-eager-instantiation/pom.xml new file mode 100644 index 0000000..2397346 --- /dev/null +++ b/feign-eager-instantiation/pom.xml @@ -0,0 +1,124 @@ + + + 4.0.0 + + org.springframework.cloud.sample + spring-cloud-sample-feign-eager-instantiation + 0.0.1-SNAPSHOT + jar + + spring-cloud-sample-feign-eager-instantiation + Demo project for Spring Cloud + + + org.springframework.boot + spring-boot-starter-parent + 1.4.1.RELEASE + + + + + UTF-8 + UTF-8 + 1.7 + + + + + org.springframework.cloud + spring-cloud-starter-feign + + + org.springframework.boot + spring-boot-devtools + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.cloud + spring-cloud-dependencies + Camden.BUILD-SNAPSHOT + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + maven-deploy-plugin + + true + + + + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/libs-snapshot-local + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/libs-milestone-local + + false + + + + spring-releases + Spring Releases + https://repo.spring.io/release + + false + + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/libs-snapshot-local + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/libs-milestone-local + + false + + + + spring-releases + Spring Releases + https://repo.spring.io/release + + false + + + + + diff --git a/feign-eager-instantiation/src/main/java/demo/ExampleClient.java b/feign-eager-instantiation/src/main/java/demo/ExampleClient.java new file mode 100644 index 0000000..91edab8 --- /dev/null +++ b/feign-eager-instantiation/src/main/java/demo/ExampleClient.java @@ -0,0 +1,12 @@ +package demo; + +import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@FeignClient(name = "example", url = "http://example.com") +public interface ExampleClient { + + @RequestMapping(value = "/", method = RequestMethod.GET) + String get(); +} diff --git a/feign-eager-instantiation/src/main/java/demo/FeignEagerInstantiationApplication.java b/feign-eager-instantiation/src/main/java/demo/FeignEagerInstantiationApplication.java new file mode 100644 index 0000000..6f00967 --- /dev/null +++ b/feign-eager-instantiation/src/main/java/demo/FeignEagerInstantiationApplication.java @@ -0,0 +1,16 @@ +package demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.feign.EnableFeignClients; + +@EnableFeignClients +// Workaround for Camden.RELEASE +// @ImportAutoConfiguration(FeignAutoConfiguration.class) +@SpringBootApplication +public class FeignEagerInstantiationApplication { + + public static void main(String[] args) { + SpringApplication.run(FeignEagerInstantiationApplication.class, args); + } +} diff --git a/feign-eager-instantiation/src/main/resources/application.properties b/feign-eager-instantiation/src/main/resources/application.properties new file mode 100644 index 0000000..e69de29 diff --git a/feign-eager-instantiation/src/test/java/demo/FeignEagerInstantiationApplicationTests.java b/feign-eager-instantiation/src/test/java/demo/FeignEagerInstantiationApplicationTests.java new file mode 100644 index 0000000..19d7769 --- /dev/null +++ b/feign-eager-instantiation/src/test/java/demo/FeignEagerInstantiationApplicationTests.java @@ -0,0 +1,18 @@ +package demo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +@DirtiesContext +public class FeignEagerInstantiationApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/pom.xml b/pom.xml index 33a1371..16a0412 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,7 @@ eureka-noweb eureka-server feign + feign-eager-instantiation feign-eureka feign-hystrix hystrix