Recognize client communication in predix (Cloud Foundry)

I have 2 microservices built using Netflix eureka. They communicate using a fake customer. In my local environment, the feign client works without any problems. But in a Predix (cloud foundry) environment, they cannot communicate. The Feign client always gives a connection timeout error. As it turned out, the feign client is trying to connect using the ip address of the instance (I think the feign client uses the internal IP address). Is there a way to fix this problem, maybe it's the ability to connect to the container or use a public uri

EDIT: I was able to get the public URL by changing the host name as shown below.

eureka: instance: hostname: ${vcap.application.uris[0]} 

but on the eureka server it is registered as $ {vcap.application.uris [0]}: [random port] (for example, xxxxxx.run.aws-usw02-pr.ice.predix.io:61142/yyy) there is a way to remove this random port.

+5
source share
1 answer

There is currently no way to assign a specific port to an application running on Predix Cloud Foundry. CF assigns a random port, as you have discovered, but it is used only inside the CF environment. Any other microservice / client / application should use only port 443 for HTTPS. That way, perhaps you can tune your Eureka client to use 443, if possible.

0
source

Source: https://habr.com/ru/post/1275954/


All Articles