この問題で明らかな何かが欠けている可能性がありますが、本番環境で動作する紺碧のワーカーの役割としてエンドポイントをデプロイすることはできないようです。ローカルのazureエミュレーターで問題なく動作します。
nservicebusサンプルに付属しているサンプルプロジェクトの1つを使用して、この問題を再現するために行った手順は次のとおりです。
- 3.2.8ビルドからサンプルをダウンロードしました。
- AzurePubSubの例を使用し、ローカル開発ストレージではなく実際のストレージの場所を使用するようにWebおよびワーカーの役割の構成を変更しました。
- ローカルコンピューティングエミュレーターを使用してローカルで実行し、Webロールとワーカーロールが期待どおりに機能することを確認しました。
- 実稼働環境にデプロイされます。Webロールは機能し、メッセージを期待どおりにキューに配置しますが、ワーカーロールはメッセージを処理しません。
例外はなく、ワーカーロールは期待どおりにデプロイおよび開始されます。メッセージを処理していないようです。
私は私が何か単純なものを見逃していることを望んでおり、誰かが以前にこの問題に遭遇したことがあります。
更新:以下のログエントリがロールのイベントログにあることがわかります。問題は、デフォルトのロギングプロファイルが127.0.0.1:10000にアクセスしようとしているということですか?
サンプルが使用するように構成されているプロファイルは次のとおりです。
NServiceBus.Production NServiceBus.OnAzureTableStorage NServiceBus.WithAzureStorageQueues
そして、ここに完全なイベントログエントリがあります:
An unhandled exception occurred. Type: System.Exception Process ID: 2512
Process Name: WaWorkerHost
Thread ID: 6
AppDomain Unhandled Exception for role OrderService_IN_0
Exception: Exception when starting endpoint, error has been logged. Reason: Unable to connect to the remote server
at NServiceBus.Hosting.GenericHost.Start()
at NServiceBus.Hosting.Azure.RoleEntryPoint.Run()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRoleInternal()
at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<StartRole>b__1()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Inner Exception: Unable to connect to the remote server
at Microsoft.WindowsAzure.Diagnostics.Management.RoleInstanceDiagnosticManager.<.ctor>b__2(Object sender, ErrorEventArgs args)
at Microsoft.WindowsAzure.Diagnostics.ControlChannel.GetControlContainer()
at Microsoft.WindowsAzure.Diagnostics.ControlChannel.set_StartupInfo(DiagnosticMonitorStartupInfo value)
at Microsoft.WindowsAzure.Diagnostics.Management.RoleInstanceDiagnosticManager..ctor(CloudStorageAccount storageAccount, String deploymentId, String roleName, String roleInstanceId)
at NServiceBus.Integration.Azure.AzureAppender.ConfigureAzureDiagnostics()
at NServiceBus.SetLoggingLibrary.Log4Net(Configure config, Object appenderSkeleton)
at NServiceBus.SetLoggingLibrary.Log4Net[TAppender](Configure config, Action`1 initializeAppender)
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at NServiceBus.Hosting.Profiles.ProfileManager.ActivateProfileHandlers()
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at NServiceBus.Configure.Initialize()
at NServiceBus.Hosting.GenericHost.Start()
Inner Exception: No connection could be made because the target machine actively refused it 127.0.0.1:10000
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
更新-解決策: 問題は、ベースラインとして使用していたサンプルプロジェクトが古い接続文字列識別子名 "Diagnostics.ConnectionString"を使用し、NServiceBus AzureLoggingAppenderが診断の保存場所"Microsoftを指定する新しい紺碧の識別子を探していたことでした.WindowsAzure.Plugins.Diagnostics.ConnectionString。 " 識別子の名前を変更すると、問題が解決しました。