microservices-patterns / ftgo-application

Example code for the book Microservice patterns
Other
3.45k stars 1.32k forks source link

Trying to run this application on Windows. I see none of the swagger UIs are accessible(The site cannot be reached) #85

Closed prakashid2 closed 4 years ago

prakashid2 commented 4 years ago

Hi.

Today I correctly followed the instructions given in README.adoc step by step. I'm trying to run the application on my local laptop i.e. on windows. Everything worked fine except some deprecation warnings. The last command I entered as below. This gave following output

ftgo-application-master> docker-compose up -d . . Creating ftgo-application-master_ftgo-api-gateway_1 ... done Creating ftgo-application-master_mysql_1 ... done Creating ftgo-application-master_zookeeper_1 ... done Creating ftgo-application-master_dynamodblocal_1 ... done Creating ftgo-application-master_zipkin_1 ... done Creating ftgo-application-master_dynamodblocal-init_1 ... done Creating ftgo-application-master_kafka_1 ... done Creating ftgo-application-master_cdc-service_1 ... done Creating ftgo-application-master_ftgo-accounting-service_1 ... done Creating ftgo-application-master_ftgo-order-service_1 ... done Creating ftgo-application-master_ftgo-restaurant-service_1 ... done Creating ftgo-application-master_ftgo-consumer-service_1 ... done Creating ftgo-application-master_ftgo-kitchen-service_1 ... done Creating ftgo-application-master_ftgo-order-history-service_1 ... done

ftgo-application-master>

Now as per the README document I tried accessing swagger UIs. But I found none of the swagger UIs are accessible. It simply says "This site can’t be reached. 192.168.99.100 refused to connect."(in my case DOCKER_HOST_IP is 192.168.99.100). I don't know why this is not working.

There is one more URL given in README.adoc which is for accessing the services via api gateway as below http://${DOCKER_HOST_IP?}:8087

In my case it is http://192.168.99.100:8087/ -This gives a Whitelabel Error Page. This means api gateway is started. Can you let me know how to access the running service via api gateway. I need the full url. Also give a sample json to invoke one service let's say 'Create Consumer'.

Since the Swagger UI's not accessible I'm a bit handicapped and have to rely on api gateway url for accessing the individual service and also the json.

Thanks Prakash S. Mumbai, India

cer commented 4 years ago

revisedLineItemQuantities is an object, where the property name/key is the menuItemId of the line item whose quantity you want to change and the property value is the new quantity.

https://github.com/microservices-patterns/ftgo-application/blob/4098a02d5eaf1fa7f1975ec433b1f97035dd838a/ftgo-end-to-end-tests/src/test/java/net/chrisrichardson/ftgo/endtoendtests/EndToEndTests.java#L141

prakashid2 commented 4 years ago

Chris. This worked as expected!! I'm now trying to deploy on Kubernetes. Command I tried.

deployment\kubernetes\scripts\kubernetes-deploy-all.sh

Encountering some error. Screenshot attached. Any idea how to overcome this? Also let me know how can I test whether deployment succeeded or failed.

Thanks Prakash S.

ErrorInDeployingOnKubernetes

prakashid2 commented 4 years ago

One more q. Every time I do :composeUp and :composeDown will the data be persistent? I had created consumer, restaurant and order earlier. That data I don't see anymore now. Does this(:composeUp) drop and recreate db?

Thanks Prakash S.

cer commented 4 years ago

Please create new and separate issues for your most recent two questions.

till213 commented 4 years ago

Hi all,

I just wanted to confirm that launching the application and accessing the Swagger URLs actually works, in my case on macOS (10.15 Mojave, for that matter):

I then followd the steps exactly as described in the README.

BUT... here's why I thought I had initially run into the same problem, as described above, specifically repeated messages like:

Waiting for cdc-service_1 to become healthy (it's unhealthy)

The launch failed indeed the first time, after several minutes. Based on this comment above I quickly figured out that this may be due to an "out of memory" situation, and indeed: in the Docker Preferences under the Resources category the maximum available memory defaulted to 2 GB only. I daringly increased this value to 6 GB.

(This puts my little MacBook Pro 13" with only 8 GB RAM into some awkward situation, I guess ;))

And even then the launch took 11 minutes - so be patient (for sure with an Intel Core i5, sweating in the heat of the summer at 2.7 GHz only):

...
Waiting for ftgo-consumer-service_1 to become healthy (it's unhealthy)
ftgo-consumer-service_1 health state reported as 'healthy' - continuing...
Waiting for ftgo-kitchen-service_1 to become healthy (it's unhealthy)
...
BUILD SUCCESSFUL in 10m 59s

Hope that helps anyone who stumbles over the same "problem"... and yes, I will totally continue experimenting on my iMac with some more horsepower and 32 GB of RAM ;)