私は最近、MSMQ を使用してサードパーティ キューイング システムをセットアップする方法に関するこの記事に従っています。パブリッシャー、キュー サーバー、およびサブスクライバーはすべて、Active Directory ドメイン内の個別のシステム上にあります。パート 1 とパート 2 の前半を完了することに成功しました。ただし、パート 2 の後半に進み、トランスポート セキュリティを有効にすると、次のエラーが表示されます。An error occurred when converting the 'mymsmqservermachine.mydomain.network.ads\private$\Path/To/MyQueuedService.svc' queue path name to the format name: Unrecognized error -1072824300 (0xc00e0014). All operations on the queued channel failed. Ensure that the queue address is valid. MSMQ must be installed with Active Directory integration enabled and access to it is available.
次のことを確認しました。
- MSMQ の Active Directory 統合は、この StackOverflow の投稿に従って、サードパーティ システムのすべてのマシンで有効になっています。
- キューへの URL は、セキュリティを有効にする前とまったく同じままです。これは問題なく機能し、解析エラーはまったくありませんでした。
- ここでMSMQ をインストールするときに、Windows が提供する指示に従いました。
私が取得するスタック トレースの関連部分は次のとおりです。
at System.ServiceModel.Channels.MsmqFormatName.FromQueuePath(String queuePath)
at System.ServiceModel.Channels.MsmqUri.ActiveDirectory.UriToFormatName(Uri uri)
at System.ServiceModel.Channels.MsmqOutputChannel.OpenQueue()
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.MsmqOutputChannel.OpenQueue()
at System.ServiceModel.Channels.MsmqOutputChannel.OnOpenCore(TimeSpan timeout)
at System.ServiceModel.Channels.MsmqOutputChannel.OnBeginOpen(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncResult.InvokeOpen()
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncResult..ctor(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.CommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.OnBeginOpen(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncResult.InvokeOpen()
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncResult..ctor(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.CommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.BeginCall(ServiceChannel channel, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.BeginCallOnce(TimeSpan timeout, CallOnceManager cascade, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.BeginEnsureOpened(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureOpen(Boolean completedSynchronously)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureInteractiveInit(IAsyncResult result, Boolean completedSynchronously)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureInteractiveInit()
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
at System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, TimeSpan timeout, AsyncCallback callback, Object asyncState)
at System.ServiceModel.Channels.ServiceChannel.BeginCall(ServiceChannel channel, ProxyOperationRuntime operation, Object[] ins, AsyncCallback callback, Object asyncState)
at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2,TArg3](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateTask(ServiceChannel channel, ProxyOperationRuntime operation, Object[] inputParameters)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateTask(ServiceChannel channel, IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
スタック トレースの内容に基づいて、失敗は Active Directory 内のキュー名の解決に起因しているようです。このような失敗を解決するために、次のことを試しました。
- ピリオドやスラッシュを含まないように名前を簡略化する (機能しませんでした)
- この手順が MSDN の元のチュートリアルから省略された場合に備えて、プライベート キューの代わりにパブリック キューを使用します (そうではなく、機能しませんでした)。
この時点で、私はアイデアがありません。以前にnet.msmqバインディングでWCFを使用しているときにこのエラーが発生し、問題を解決した人はいますか?
編集:同じマシンと同じユーザーから次のテスト コードを実行すると、メッセージをキューに完全に送信できます。
Me.TestContext.WriteLine("Executing under user '{0}'", WindowsIdentity.GetCurrent().Name)
Dim msg = New System.Messaging.Message()
msg.Body = "This is a test message"
msg.Label = "Test Message"
msg.Formatter = new ActiveXMessageFormatter()
Dim queue = new MessageQueue("FormatName:DIRECT=OS:mymsmqservermachine.mydomain.network.ads\private$\Path/To/MyQueuedService.svc")
queue.Send(msg)