Closed HarshaRaikar closed 7 years ago
For queries, you call it the same way you do it from the MVC app, for instance. Using HttpClient, similar code than what you have. The important point is to use the internal name resolution based on the names of the microservices, like we do: For instance, this is the env-var we use at the Catalog microservice, defined at the docker-compose.override.yml: CatalogUrl=http://**catalog.api**:5101 You could also use catalog.api within the C# code, if you'd like. In your code you have {_remoteServiceBaseUrl}, I guess it container the "/" needed? What's the value of {_remoteServiceBaseUrl} in your case?
In regards updates, or how to propagate changes between microservices, that communication should be asynchronous and based on events. We're building a sample EventBus in the dev branches using a RabbitMQ container for the underneath messaging, etc.
But for quering, Http with HttpClient is the most usual approach.
Closing this issue (question) until further notice
Hi,
How do I call a microservice function from another?
I want to call Catalog service function from another service .I am doing the following public async Task GetCatalogItem(string name)
{
_apiClient = new HttpClient();
But I am getting the error : "CurlException: Couldn't connect to server"
Thanks -Harsha