I have deployed the configuration server, the service discoverer, the gateway and finally the microservices, all in that order.
The discoverer registers the microservices correctly, however there is no communication between the microservices. In my projects I have used webClient for communication. And it also doesn't work when I access an endpoint through the gateway.
{
"name":"gateway-service",
"profiles":[
"default"
],
"label":null,
"version":"4940e9732dd2dfe06e5d0f1b847bfbfbc9adb",
"state":null,
"propertySources":[
{
"name":"https://github.com/user/gateway-service.yml",
"source":{
"eureka.client.serviceUrl.defaultZone":"http://XX.YYY.ZZ4.111:8761/eureka",
"spring.cloud.gateway.discovery.locator.enabled":true,
"spring.cloud.gateway.routes[0].id":"first-service",
"spring.cloud.gateway.routes[0].uri":"http://XX.XX2.17.84:8045",
"spring.cloud.gateway.routes[0].predicates[0]":"Path=/api/v1/first/**",
"spring.cloud.gateway.routes[1].id":"second-service",
"spring.cloud.gateway.routes[1].uri":"http://52.1XX.XX.180:9696",
"spring.cloud.gateway.routes[1].predicates[0]":"Path=/api/v1/second/**",
"spring.cloud.gateway.routes[2].id":"third-service",
"spring.cloud.gateway.routes[2].uri":"http://XX.XX4.19.229:9393",
"spring.cloud.gateway.routes[2].predicates[0]":"Path=/api/v1/third/**",
}
}
]
}
Example of a microservice configuration in the Github repository.
server:
port: 9696
spring:
application:
name: second-service
data:
mongodb:
uri: mongodb+srv://user:password@cluster0.1vbbi.mongodb.net/database?retryWrites=true&w=majority
eureka:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://XX.YYY.ZZ4.111:8761/eureka
I have checked the azure aks log and I don't see any errors. I did everything with the kubernetes service and not with Azure Spring Cloud.