Comments (1)
Thanks for your issue. You make an excellent point about the tests. My goal originally was to make this a very simple project for demonstration purposes. The lack of tests was due to me not having the time to make another guide that articulated a strategy for end-to-end integration testing with microservices. I thought also that contributions might be made by others for the tests, but none have come in.
To answer your questions:
Any plans on adding any integration tests?
Yes, I think it's a good time to add in some tests since the project is becoming pretty popular.
Do you have an approach on your mind to solve the DNS issue pragmatically?
I've been writing about this topic in a book and it has sample applications, similar to this one. There are some integration tests that are rather simple to do, using embedded data sources. The integration tests that are more difficult to resolve are the services where databases cannot be embedded. In this case, the database must be available at some location, whether it is local or remote.
To achieve this on a remote build server, like Travis, I decided to create a Docker image that will use the AWS CLI to create an ephemeral VM instance with Docker Compose installed: https://github.com/kbastani/docker-run-ec2
For a local Maven build, you can use Docker Compose to launch the images that have already been built and added to your local Docker registry. After the containers have started, you can run the Maven tests again and externalize the configuration for each service host. Or, you can just run dependencies as one-off containers. For the discovery service:
$ docker run -ti --rm --name discovery -p 8761:8761 kbastani/discovery-microservice
For the movies-ui
project, which you referenced in your log output, the problem was that the discovery service host name couldn't be reached. We can override this in the maven build by exporting the Eureka service URL as a environment variable, like below.
$ export EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://192.168.99.100:8761/eureka/
$ mvn test
The log output will now show a successful connection to the discovery service at the overridden Eureka URL.
2016-02-14 01:59:21.737 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2016-02-14 01:59:21.737 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2016-02-14 01:59:21.737 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2016-02-14 01:59:21.737 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
2016-02-14 01:59:21.737 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2016-02-14 01:59:21.737 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2016-02-14 01:59:21.737 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2016-02-14 01:59:21.837 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : The response status is 200
2016-02-14 01:59:21.839 INFO 1947 --- [ main] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
2016-02-14 01:59:21.918 WARN 1947 --- [ Thread-3] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [current=DOWN, previous=STARTING]
2016-02-14 01:59:21.920 INFO 1947 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_MOVIESUI/10.232.132.65:moviesui:-1: registering service...
2016-02-14 01:59:21.946 INFO 1947 --- [ Thread-3] com.netflix.discovery.DiscoveryClient : DiscoveryClient_MOVIESUI/10.232.132.65:moviesui:-1 - deregister status: 404
from spring-cloud-microservice-example.
Related Issues (20)
- how does Configuration Service signal a refresh to Discovery Service signal a refresh
- can i use maven 3.5 on linux
- after start up...a few of the services are in Exit 137 state and im getting 404 for the configserver
- What tools to draw the micro-service design? HOT 1
- mvn clean install failure
- demo usage
- Cannot execute request on any known server
- What's the right sequence to start projects?
- Can't Access Docker Repos HOT 1
- docker-compose up some error
- Connection to http://localhost:8500 refused HOT 1
- Since there is a parent, it is also a import, why
- Could you please update project to use Spring Boot version 2.0.4.RELEASE ?
- http://localhost:9006/ error
- I am able to run this whole code on windows? But how to access URL and what to execute ?
- Connection Refused
- Want to compile the code. HOT 1
- Unable to build project. Some processing while processing the POMs
- Are these images available in docker hub?
- Could you please update code to use latest dependencies? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-cloud-microservice-example.