-
Notifications
You must be signed in to change notification settings - Fork 6
Hosting DTF Microservices
Damir Dobric edited this page Oct 19, 2017
·
2 revisions
DTF Microservices framework provides an easy hosting model for DTF orchestrations. By using of Host-API implemented in namespace Daenet.DurableTaskMicroservices.Host, any kind of host can easily be implemented. At the moment hosting supports Windows Service Host and Self-host.
Following example shows how to run the host in your application (i.e.: Console Application)
Daenet.DurableTaskMicroservices.Host.Host host = new Daenet.DurableTaskMicroservices.Host.Host();
// Loads configuration from application base.
host.StartServiceHost();
// Shows how config file can be placed on some explicit location.
// host.StartServiceHost(Path.Combine(AppContext.BaseDirectory, "TestConfiguration"));
Thread.Sleep(int.MaxValue);
To run this example, you will need some sort of configuration. Right now, configuration consists of two parts. First configuration part is the configuration of the microservice itself, which is described in this article
Second part of configuration is related to host. It contains configuration for Service Bus, Storage Account and TaskHub name.
<configuration>
.. omitted ..
<appSettings>
<add key="TaskHubName" value="YOURHUBNAME"/>
</appSettings>
<connectionStrings>
<add name="ServiceBus" connectionString="Endpoint=sb://YOURNAMESPACE.servicebus.windows.net/;SharedAccessKeyName=DTF;SharedAccessKey=***" />
<add name="Storage" connectionString="DefaultEndpointsProtocol=https;AccountName=YOURACCOUNT;AccountKey=***;EndpointSuffix=core.windows.net" />
</connectionStrings>
</configuration>