swe574-group2 / swe574

This repository is created for the course named "SWE 574 - Software Development as a Team".
5 stars 0 forks source link

micro service creation with eureka #47

Closed penumbram-zz closed 7 years ago

penumbram-zz commented 7 years ago
screen shot 2016-11-01 at 01 24 30

somehow managed to make the test app work. the trick is to run the eureka client first, and then run the discovery client

penumbram-zz commented 7 years ago

microservicedemo.zip uploading the zipped working project, and the guide I used for it is: we shouldn't need the zip. I'll be happy to do the same steps with our project, so if you don't wanna, leave this micro-service part to me. I'll take care of it before saturday. https://spring.io/guides/gs/service-registration-and-discovery/

penumbram-zz commented 7 years ago

@okanmenevseoglu @ardaofluoglu @gr3ysky @seydakaradag @skanca

commit fa6e395 has a great difference in terms of the server side.

Now we have micro services, running on an umbrella server. From now on, to run the server on your machine, you have to first run the EurekaCatPluginServerApplication

And when it runs successfully (you can check by visiting localhost:1111) which will show you the following page:

screen shot 2016-11-05 at 15 55 26

As you can see, the instances currently registered with eureka is empty at the moment. To run an instance, (in our case, we have 2 instances to run on this eureka server, one is the annotation service, and the other is the accounts), you need to run its initializer just like you used to, like:

screen shot 2016-11-05 at 15 57 40

will run the instance on your port 8080, just like before. You can check by visiting localhost:1111 again, which should show:

screen shot 2016-11-05 at 15 59 39

Now, you can use the server just like you used to, because now your server is running on port 8080. But if you want to see how the magic happens, run the AccountsService class just like the AnnotationService, in which case you'll see:

screen shot 2016-11-05 at 16 01 55

two instances running on your server. Now when you visit localhost:8081/accounts, you should see the dummy page:

screen shot 2016-11-05 at 16 03 29

The two servers run on two different ports so they aren't linked, visiting localhost:8080/accounts for example will not render any meaningful page. As for the front-end developers, you don't need to run the second server for now since we aren't using any functionality from it for now.