I'm trying to have a stateless ASP.NET Core service communicate with a stateful ASP.NET core service by using the following configuration on the stateful service:
protected override IEnumerable<ServiceReplicaListener> CreateServiceReplicaListeners()
{
return new ServiceReplicaListener[]
{
new ServiceReplicaListener(serviceContext =>
new KestrelCommunicationListener(serviceContext, (url, listener) =>
{
ServiceEventSource.Current.ServiceMessage(serviceContext, $"Starting Kestrel on {url}");
return new WebHostBuilder()
.UseKestrel()
.ConfigureServices(
services => services
.AddSingleton<StatefulServiceContext>(serviceContext)
.AddSingleton<IReliableStateManager>(this.StateManager))
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.UseUniqueServiceUrl)
.UseUrls(url)
.Build();
}))
};
}
I know how to use the reverse proxy by using the following URL http://localhost:19081/App/Service/api/events?PartitionKey=0&PartitionKind=Int64Range
but I'm confused on how to use it without the reverse proxy. If I try using fabric:/App/Service
how do I specify the partition? Also, I can't seem to do this with the HttpClient
class since it only accepts HTTP or HTTPs.