Deprecated: use Microsoft.Orleans.ServiceFabric
Support for hosting Orleans on Serivce Fabric is now included in the Orleans core repository and published via the Microsoft.Orleans.ServiceFabric package.
This is a simple library which allows Orleans to be hosted on Service Fabric.
- Create a stateless service to host your actors.
- Install the Orleans Service Fabric Silo package:
PM> Install-Package Microsoft.Orleans.ServiceFabric.Silo -Pre
- Alter the
CreateServiceInstanceListeners
method to construct anOrleansCommunicationListener
, like so:
protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
{
var silo =
new ServiceInstanceListener(
parameters =>
new OrleansCommunicationListener(parameters, this.GetClusterConfiguration(), this.ServicePartition));
return new[] { silo };
}
- Install the Orleans Service Fabric Client package:
PM> Install-Package Microsoft.Orleans.ServiceFabric.Client -Pre
Then consume it in the client, initializing Orleans like so:
OrleansFabricClient.Initialize(new Uri("fabric:/CalculatorApp/CalculatorService"), this.GetConfiguration());
Replace fabric:/CalculatorApp/CalculatorService
with the Service Fabric URI of the service created earlier.
In your ServiceManifest.xml
, add the following endpoints:
<Endpoint Name="OrleansSiloEndpoint" Type="Internal" Protocol="tcp"/>
<Endpoint Name="OrleansProxyEndpoint" Type="Internal" Protocol="tcp"/>
- Start the Azure Storage Emulator - it is currently needed for Orleans to discover other nodes.
- Debug
CalculatorApp
from Visual Studio. - Run
TestClient.exe get
from TestClient's output directory. - Run
TestClient.exe add 3.14
from TestClient's output directory.
Hope this helps :) Hit me up on @ReubenBond if you have questions.
Join us! Orleans is a warm, welcoming community & we're on Gitter: