I have two applications(say app1 and app2) in my cluster. Both these applications have Stateless Service as a gateway to connect to internal Stateful services. I am trying to make calls between these two applications. I have made Reverse Proxy Service Communication from app1 to app2.
Url to app2 from app1 : http://localhost:19081/app2/stateless_app2_service/api/values
The above scenario works fine within local cluster. But when deployed on Azure Cluster it's taking 2 minutes to reach app2.
Can someone help me in pointing what I am doing wrong that's causing this delay? Is this related to any of the cluster configurations? I have enabled port 19081 for reverseproxy in the ARM while creating the cluster.
Below is my event logger for the calls made through services on Azure cluster. Call is received after 2 minutes. It's happening with every call that involves Inter-application communication in the Azure cluster.
Code:
Stateless_app1_service
protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
{
return new ServiceInstanceListener[]
{
new ServiceInstanceListener(serviceContext =>
new KestrelCommunicationListener(serviceContext, "ServiceEndpoint", (url, listener) =>
{
ServiceEventSource.Current.ServiceMessage(serviceContext, $"Starting Kestrel on {url}");
return new WebHostBuilder()
.UseKestrel()
.ConfigureAppConfiguration((builderContext, config) =>
{
config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
})
.ConfigureServices(
services => services
.AddSingleton<HttpClient>(new HttpClient())
.AddSingleton<StatelessServiceContext>(serviceContext)
.AddSingleton<ILogger>(GenerateLogger()))
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.None)
.UseUrls(url)
.Build();
}))
};
}
Making the call:
_logger.TrackEvent("SF - Call made to other application");
var response2 = await _httpClient.GetAsync($"{_reverseProxy}/{_appNameConnectors}/{_apiNameConnectors}/api/Values");
_logger.TrackEvent("SF- RPC - Call successfully finished!");