Unable to contact the service using DNS in the service
I am trying to get a stateless service to send a value to another, just to achieve communication between services using a DNS service in the service. I tested both apps with postman and they work great. I am following this tutorial where it seems pretty straight forward to do this.
Stateless service has DNS name: DNS name configured in ApplicationManifest.xml
<Service Name="SocketService"
ServiceDnsName="SocketService.TimeSeriesActorApplication"
ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="SocketServiceType"
InstanceCount="[SocketService_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
Then I try to send http access to the service like in the tutorial.
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("http://socketservice.timeseriesactorapplication:8712/api/");
var response = await client.GetAsync("values");
}
But I am getting an exception:
WebException: The remote name could not be resolved: 'socketservice.timeseriesactorapication'
This happens when I use port 8080 as the tutorial suggests, and when I use the port I specify in the ServiceManifest.xml.
<Endpoints>
<Endpoint Protocol="http" Name="ServiceEndpoint" Type="Input" Port="8712" />
</Endpoints>
What am I missing here?
Update: Using localhost instead of dns-name also works great.
Github issue: Unable to resolve DNS name of service # 332
source to share
I see that you are using Service Cloth 5.6.210. In the recent 5.6.220 release ( https://blogs.msdn.microsoft.com/azureservicefabric/2017/06/20/release-of-sdk-2-6-220-and-runtime-5-6-220-refresh -for-windows / ) contains some fixes for the DNS service. Note that although I am running 5.6.220, I noticed that DNS name resolution does not always start working immediately after deploying to my local machine (I need to redistribute or wait a few minutes). If you are working locally, you can check name resolution in a terminal window - just ping the DNS name of the service.
source to share