paulc4 / microservices-demo

Demo application to go with Blog on spring.io
889 stars 830 forks source link

500 internal server error #2

Closed rhonan closed 8 years ago

rhonan commented 8 years ago

Hi,

I'm running 1 registration, 1 web and 2 accounts, but when I close one of the accounts microservice sometimes I get the following error when I try a /accounts/123456789 :

error

I think it tries to send a request to the closed microservice, but it's already unregistered, it doesn't even show in the eureka's dashboard.

Thank you.

paulc4 commented 8 years ago

Actually I think it is still wating for an account-service to register. By default this takes up to 30s. It may also be because the code until today did not support multiple instances on the same host - Eureka only remembers the last one registered - so when you kill one, it has forgotten the other. This worked when I originally wrote the blog, but changed soon after. As of release-train Brixton, this is fixed again!

I have updated my blog to cover these issues: https://spring.io/blog/2015/07/14/microservices-with-spring#configuration-options.

rhonan commented 8 years ago

I did the same test again with the current project and had the same result. :( My second account-service is opened inside a Virtual Machine.

1 registration, 1 web and 1 account opened on my machine... 1 account inside a Virtual Machine. dashboard Did a few requests at http://localhost:3333/accounts/123456789 with no problems then closed the account service that was running on my machine. dashboard2 Next request: error

In order to the account service that was running inside the Virtual Machine connect on the registration service (running on my Machine) I updated the eureka.client.serviceUrl.DefaultZone to my local IP.

After a few tries it goes back to normal.

paulc4 commented 8 years ago

Sorry, I don't understand this sentence:

In order to the account service that was running inside the Virtual Machine connect on the registration service (running on my Machine) I updated the eureka.client.serviceUrl.DefaultZone to my local IP.

Both account services should be defining the same eureka.client.serviceUrl.DefaultZone property. Is that what you mean?

rhonan commented 8 years ago

My apologies. Yes, the difference is that one was using "localhost" (because it was running in the same host of the registration service) and the other was using the ip address from the machine that was running the registration service.

piyush25890 commented 8 years ago

hiii... can u please tell me how to run this project... and environmet required to run this demo microservice its urgent.... please help me.......................

rhonan commented 8 years ago

@piyush25890 You can follow the the instructions at https://github.com/paulc4/microservices-demo#command-line

paulc4 commented 8 years ago

@rhonan Thanks Rhonan.

piyush25890 commented 8 years ago

thanku so much @rhonan @paulc4