-
Notifications
You must be signed in to change notification settings - Fork 827
JAV-30 Auto Configration code for spring-boot-starter-discovery #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
4 changes: 2 additions & 2 deletions
4
...pring-boot-discovery/demo-spring-boot-discovery-client/src/main/resources/application.yml
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
server: | ||
port: 8088 | ||
port: 9993 | ||
spring: | ||
cloud: | ||
cse: | ||
host: 127.0.0.1 | ||
port: 9980 | ||
port: 30100 |
12 changes: 6 additions & 6 deletions
12
...ing-boot-discovery/demo-spring-boot-discovery-client/src/main/resources/microservice.yaml
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
APPLICATION_ID: springmvctest | ||
APPLICATION_ID: discoverytest | ||
service_description: | ||
name: springmvc | ||
version: 0.0.1 | ||
name: discovery | ||
version: 0.0.2 | ||
cse: | ||
service: | ||
registry: | ||
address: http://127.0.0.1:9980 | ||
address: http://127.0.0.1:30100 | ||
references: | ||
springmvc: | ||
version-rule: 0.0.1 | ||
discovery: | ||
version-rule: 0.0.2 |
25 changes: 25 additions & 0 deletions
25
...iscovery-client/src/test/java/io/servicecomb/demo/discovery/client/DiscoveryClientIT.java
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.servicecomb.demo.discovery.client; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import io.servicecomb.demo.TestMgr; | ||
|
||
public class DiscoveryClientIT { | ||
|
||
@Before | ||
public void setUp() { | ||
TestMgr.errors().clear(); | ||
} | ||
|
||
@Test | ||
public void clientGetsNoError() throws Exception { | ||
DiscoveryClient.main(new String[0]); | ||
System.out.println(TestMgr.errors().toString()); | ||
assertThat(TestMgr.errors().isEmpty(), is(true)); | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
demo/demo-spring-boot-discovery/demo-spring-boot-discovery-server/pom.xml
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.servicecomb.demo</groupId> | ||
<artifactId>demo-spring-boot-discovery</artifactId> | ||
<version>0.1.0-m2-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>demo-spring-boot-discovery-server</artifactId> | ||
<name>demo-spring-boot-discovery-server</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.servicecomb.demo</groupId> | ||
<artifactId>demo-schema</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.servicecomb</groupId> | ||
<artifactId>provider-springmvc</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<properties> | ||
<demo.main>io.servicecomb.demo.discovery.server.DiscoveryServer</demo.main> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.github.odavid.maven.plugins</groupId> | ||
<artifactId>mixin-maven-plugin</artifactId> | ||
<configuration> | ||
<mixins> | ||
<mixin> | ||
<groupId>io.servicecomb.demo</groupId> | ||
<artifactId>docker-build-config</artifactId> | ||
<version>0.1.0-m2-SNAPSHOT</version> | ||
</mixin> | ||
</mixins> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>docker</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.commonjava.maven.plugins</groupId> | ||
<artifactId>directory-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test doesn't have much meaning except ensured DiscoveryClient can be started up.
Nothing related to how services discovery with spring cloud integration and load balancing was tested.
We have to be sure we are able to forward requests to corresponding services from zuul with service center
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Written demo/IT code for: