Commit 86ac0127 by Spencer Gibb

Upgrade eureka to 1.4.1

Plus polish fixes gh-836
parent 10436160
...@@ -61,10 +61,10 @@ import com.netflix.zuul.http.ZuulServlet; ...@@ -61,10 +61,10 @@ import com.netflix.zuul.http.ZuulServlet;
public class ZuulConfiguration { public class ZuulConfiguration {
@Autowired @Autowired
private ZuulProperties zuulProperties; protected ZuulProperties zuulProperties;
@Autowired @Autowired
private ServerProperties server; protected ServerProperties server;
@Autowired(required = false) @Autowired(required = false)
private ErrorController errorController; private ErrorController errorController;
......
...@@ -64,12 +64,6 @@ public class ZuulProxyConfiguration extends ZuulConfiguration { ...@@ -64,12 +64,6 @@ public class ZuulProxyConfiguration extends ZuulConfiguration {
private DiscoveryClient discovery; private DiscoveryClient discovery;
@Autowired @Autowired
private ZuulProperties zuulProperties;
@Autowired
private ServerProperties server;
@Autowired
private ServiceRouteMapper serviceRouteMapper; private ServiceRouteMapper serviceRouteMapper;
@Override @Override
......
...@@ -16,13 +16,14 @@ ...@@ -16,13 +16,14 @@
package org.springframework.cloud.netflix.zuul; package org.springframework.cloud.netflix.zuul;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.TestRestTemplate; import org.springframework.boot.test.TestRestTemplate;
import org.springframework.boot.test.WebIntegrationTest;
import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.netflix.ribbon.RibbonClients; import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.cloud.netflix.ribbon.SpringClientFactory; import org.springframework.cloud.netflix.ribbon.SpringClientFactory;
...@@ -36,7 +37,6 @@ import org.springframework.http.HttpStatus; ...@@ -36,7 +37,6 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -48,13 +48,17 @@ import static org.junit.Assert.assertTrue; ...@@ -48,13 +48,17 @@ import static org.junit.Assert.assertTrue;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = SampleHttpClientZuulProxyApplication.class) @SpringApplicationConfiguration(classes = SampleHttpClientZuulProxyApplication.class)
@WebAppConfiguration @WebIntegrationTest(randomPort = true, value = {
@IntegrationTest({ "server.port: 0",
"zuul.routes.other: /test/**=http://localhost:7777/local", "zuul.routes.other: /test/**=http://localhost:7777/local",
"zuul.routes.another: /another/twolevel/**", "zuul.routes.simple: /simple/**" }) "zuul.routes.another: /another/twolevel/**", "zuul.routes.simple: /simple/**" })
@DirtiesContext @DirtiesContext
public class SampleZuulProxyWithHttpClientTests extends ZuulProxyTestBase { public class SampleZuulProxyWithHttpClientTests extends ZuulProxyTestBase {
@Before
public void init() {
super.setTestRequestcontext();
}
@Test @Test
public void patchOnSelfViaRibbonRoutingFilter() { public void patchOnSelfViaRibbonRoutingFilter() {
ResponseEntity<String> result = new TestRestTemplate().exchange( ResponseEntity<String> result = new TestRestTemplate().exchange(
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<spring-cloud-config.version>1.1.0.BUILD-SNAPSHOT</spring-cloud-config.version> <spring-cloud-config.version>1.1.0.BUILD-SNAPSHOT</spring-cloud-config.version>
<spring-cloud-stream.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-stream.version> <spring-cloud-stream.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-stream.version>
<archaius.version>0.7.3</archaius.version> <archaius.version>0.7.3</archaius.version>
<eureka.version>1.3.8</eureka.version> <eureka.version>1.4.1</eureka.version>
<feign.version>8.14.4</feign.version> <feign.version>8.14.4</feign.version>
<hystrix.version>1.4.23</hystrix.version> <hystrix.version>1.4.23</hystrix.version>
<ribbon.version>2.1.0</ribbon.version> <ribbon.version>2.1.0</ribbon.version>
......
...@@ -42,10 +42,21 @@ public class CloudEurekaTransportConfig implements EurekaTransportConfig { ...@@ -42,10 +42,21 @@ public class CloudEurekaTransportConfig implements EurekaTransportConfig {
private String readClusterVip; private String readClusterVip;
private String writeClusterVip;
private boolean bootstrapResolverForQuery = true; private boolean bootstrapResolverForQuery = true;
private String bootstrapResolverStrategy;
private boolean applicationsResolverUseIp = false;
@Override @Override
public boolean useBootstrapResolverForQuery() { public boolean useBootstrapResolverForQuery() {
return this.bootstrapResolverForQuery; return this.bootstrapResolverForQuery;
} }
@Override
public boolean applicationsResolverUseIp() {
return this.applicationsResolverUseIp;
}
} }
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
<artifactId>eureka-client</artifactId> <artifactId>eureka-client</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.netflix.eureka</groupId>
<artifactId>eureka-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-archaius</artifactId> <artifactId>spring-cloud-starter-archaius</artifactId>
</dependency> </dependency>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment