eventuate-examples / eventuate-tram-sagas-quarkus-examples-customers-and-orders

Other
4 stars 4 forks source link

JDBC connection error and RESTEASY error #4

Open sundar-cs opened 2 years ago

sundar-cs commented 2 years ago

mysqlComposeUp results in this loop forever: Waiting for customer-service_1 to become healthy

The following trace was seen in the logs. docker logs eventuate-tram-sagas-quarkus-examples-customers-and-orders-main_customer-service_1

at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) at com.mysql.cj.NativeSession.connect(NativeSession.java:144) at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826) ... 11 more Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method)

The order service too fails in a similar way.

Analogous to the CDC service, this environment variable was added in the YML for the customer and order services: SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver

However mySqlComposeUp still fails with the above error (though at times it does seem to work). Hence tried manually restarting these two services (customer & order) and they're able to come Up and remain in healthy state. (docker start eventuate-tram-sagas-quarkus-examples-customers-and-orders-main_customer-service_1 and similarly for the order service)

However even though the services are Up (after a manual restart), the UI doesn't come up most of the time, giving error as follows: RESTEASY003210: Could not find resource for full path: http://localhost:8081/swagger-ui/index.html

Please let me know what could be the issues causing these problems ? Thanks a lot.

dartartem commented 2 years ago

hi @sundar-cs, thank you for the issue.

Project does not yet support swagger unfortunately.

To properly start project, please use ./gradlew mysqlCdcComposeUp first and then ./gradlew mysqlComposeUp because docker-compose does not respect service dependencies and infrastructure should be started first.

sundar-cs commented 2 years ago

Thanks so much for your response and for confirming that it's indeed a timing issue. I tried your suggestion and it's working well. Also thanks for confirming that UI is not supported as of now.

sundar-cs commented 2 years ago

I had a question/comment on the UI support. After adding these lines in application.properties in customer-service and order-service, the UI comes up properly: quarkus.swagger-ui.always-include=true quarkus.swagger-ui.path=/swagger-ui

Of course I haven't added the test cases etc. but just wanted to find out is there any catch/reason why the above has not been done yet in the main branch ?

Thanks again.

dartartem commented 2 years ago

I had a question/comment on the UI support. After adding these lines in application.properties in customer-service and order-service, the UI comes up properly: quarkus.swagger-ui.always-include=true quarkus.swagger-ui.path=/swagger-ui

Of course I haven't added the test cases etc. but just wanted to find out is there any catch/reason why the above has not been done yet in the main branch ?

Thanks again.

Hi @sundar-cs, probably I just missed it.

sundar-cs commented 2 years ago

Sure thank you for confirming this.