既存の Cloud Service WorkerRole をステートレス サービスとして Service Fabric に移植しています。元のクラウド サービスは、SignalR と Service Bus (SignalR バックプレーンとして) を使用して、リッスンしているクライアントに通知を送信します。セットアップの一部を行う Startup クラスがあります。
class Startup
{
public void Configuration(IAppBuilder app)
{
String connectionString = "Endpoint=sb://[name].servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=[key]";
GlobalHost.DependencyResolver.UseServiceBus(connectionString, "InSys");
app.MapSignalR();
Notifications.Hub = GlobalHost.ConnectionManager.GetHubContext<MyHub>();
}
}
WorkerRole の OnStart() メソッドで、次のように OWIN を開始します。
var endpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["HttpEndpoint"];
var baseUri = $"{endpoint.Protocol}://{endpoint.IPEndpoint}";
var app = WebApp.Start<Startup>(new StartOptions(url: baseUri));
これ (つまり、SignalR サービス バス バックプレーンへの接続) は、Service Fabric 内のステートレス サービスに対してどのように行われますか?