2

NSB のバージョン 3.2.6 では、次のようにエンドポイントをアプリ構成にマップしました。

<UnicastBusConfig>
  <MessageEndpointMappings>
    <add Messages="Foo.Bar.Baz1, Foo.Interfaces" Endpoint="Foo.Bar.Monitor" />
    <add Messages="Foo.Bar.Baz2, Foo.Interfaces" Endpoint="Foo.Bar.Monitor" />
    <add Messages="Foo.Bar.Baz3, Foo.Interfaces" Endpoint="Foo.Bar.Monitor" />
  </MessageEndpointMappings>
</UnicastBusConfig>

これはうまくいきました。NSB 3.3.8 にアップグレードしたとき、endpointmappings の API が変更されたこと、特に属性Messagesが deprecatedであることを確認したので、コードを新しいメソッドの 1 つに移植しようとしました。それらのどれも機能しません。私が試した3つの異なる方法は次のとおりです。

<UnicastBusConfig>
  <MessageEndpointMappings>
    <add Assembly="Foo.Interfaces" Endpoint="Foo.Bar.Monitor" />
  </MessageEndpointMappings>
</UnicastBusConfig>
<UnicastBusConfig>
  <MessageEndpointMappings>
    <add Assembly="Foo.Interfaces" Namespace="Foo.Bar" Endpoint="Foo.Bar.Monitor" />
  </MessageEndpointMappings>
</UnicastBusConfig>
<UnicastBusConfig>
  <MessageEndpointMappings>
    <add Assembly="Foo.Interfaces" Type="Foo.Bar.Baz1" Endpoint="Foo.Bar.Monitor" />
    <add Assembly="Foo.Interfaces" Type="Foo.Bar.Baz2" Endpoint="Foo.Bar.Monitor" />
    <add Assembly="Foo.Interfaces" Type="Foo.Bar.Baz3" Endpoint="Foo.Bar.Monitor" />
  </MessageEndpointMappings>
</UnicastBusConfig>

これらの方法のいずれかを使用して、を送信しようとするとBaz1InvalidOperationException: No destination specified for message(s): Foo.Bar.Baz1.

タイプ名に意図的にタイプミスを入れた場合 (例: Foo.Bar.Bazzzzz1)、指定されたタイプが見つからない場合、NSB は起動時に正しくエラーになり、タイプミスのないタイプに何かが起こっているに違いないことを示します。

この問題は、エンドポイントをへのパラメータとして直接指定することで回避できSendますが、NSB はそれを行わないことを推奨しています。

私の質問は次のとおりです。私の設定でまだ何か間違っているのでしょうか、それとも本当に NSB 3.3.8 のバグなのでしょうか?

4

0 に答える 0