我想抓住NSerivceBus,雖然它主要是順利進行,但我正在努力瞭解如何配置EndPointName。Nservice總線端點命名
因此,例如,下面的幾個例子後,我設法想出了以下內容,但是我爲改變EndPoint Name所做的任何嘗試都失敗了。
所以myServer上隊列目前它被命名,取,我覺得從命名空間中的位置:
namespace MyServer
{
class EndPointConfig : IConfigureThisEndpoint, AsA_Server
{
}
}
但是當我把[EndpointName(「AnotherQueue」)沒有什麼變化(除非它不填寫。在myServer上隊列
我也試圖改變在Global.asax:
public static IBus Bus { get; set; }
void Application_Start(object sender, EventArgs e)
{
Bus = NServiceBus.Configure.With()
.Log4Net()
.DefaultBuilder()
.DefineEndpointName("AnotherQueue")
.XmlSerializer()
.MsmqTransport()
.IsTransactional(false)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.CreateBus()
.Start();
}
但同樣,它沒有工作
。 0我正在通過查看mmc並檢查排隊消息來測試它。
最後我試圖改變的web.config
<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NserviceBus.Core"/>
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core"/>
</configSections>
<MsmqTransportConfig ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5"/>
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="MyMessage" Endpoint="AnotherQueue"></add>
</MessageEndpointMappings>
</UnicastBusConfig>
,仍然一無所獲。
有人能幫忙嗎?我仍然試圖讓自己頭腦發熱(這對我來說是一種新技術),所以如果我對這個問題提出質疑的話,那麼我就會大聲疾呼。
在此先感謝 萊克斯
DefineEndPointName()必須在DefaultBuilder()之前。請參閱https://github.com/Particular/NServiceBus/issues/277 –