2011-02-10 40 views
0

出版商配置 發佈消息無法到達用戶

<!-- 1. In order to configure remote endpoints use the format: "[email protected]" 
     2. Input queue must be on the same machine as the process feeding off of it. 
     3. Error queue can (and often should) be on a different machine. 
     4. The community edition doesn't support more than one worker thread. 
    --> 

    <MsmqTransportConfig 
    InputQueue="HomeOfficePublisherQueue" 
    ErrorQueue="error" 
    NumberOfWorkerThreads="1" 
    MaxRetries="5" 
    UseJournalQueue="true" 
    /> 

    <DBSubscriptionStorageConfig> 
    <NHibernateProperties> 
     <add Key="connection.provider" 
      Value="NHibernate.Connection.DriverConnectionProvider"/> 
     <add Key="connection.driver_class" 
      Value="NHibernate.Driver.SqlClientDriver"/> 
     <add Key="connection.connection_string" 
      Value="Server=<dbserver>\corpdev;initial catalog=NServiceBus;Integrated Security=SSPI"/> 
     <add Key="dialect" 
      Value="NHibernate.Dialect.MsSql2005Dialect"/> 
    </NHibernateProperties> 
    </DBSubscriptionStorageConfig> 

    <UnicastBusConfig 
    DistributorControlAddress="" 
    DistributorDataAddress="" 
    ForwardReceivedMessagesTo=""> 
    <MessageEndpointMappings> 
    </MessageEndpointMappings> 
    </UnicastBusConfig> 


</configuration> 

用戶配置

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <configSections> 
    <section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" /> 
    <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" /> 
    </configSections> 

    <!-- 1. In order to configure remote endpoints use the format: "[email protected]" 
     2. Input queue must be on the same machine as the process feeding off of it. 
     3. Error queue can (and often should) be on a different machine. 
     4. The community edition doesn't support more than one worker thread. 
    --> 

    <MsmqTransportConfig 
    InputQueue="[email protected]<subscriberServer>" 
    ErrorQueue="error" 
    NumberOfWorkerThreads="1" 
    MaxRetries="5" 
    UseJournalQueue="true" 
    /> 

    <UnicastBusConfig> 
    <MessageEndpointMappings> 
     <add Messages="Message" Endpoint="[email protected]<publisherServer>" /> 
    </MessageEndpointMappings> 
    </UnicastBusConfig> 

</configuration> 

當我從不同勢機器上運行的酒吧和子,從發行該消息不到達用戶。如果我在同一臺機器上運行它們,它們工作正常。

=>發佈者在本機上運行,​​發佈者隊列在本地創建。

=>用戶正在其上運行的機器相同。

配置文件是生產配置,日誌文件中沒有例外。

任何線索爲什麼消息被丟棄。 Thsnks求救...

+0

一些與標籤錯誤,請將服務器讀爲「=>發佈服務器在此計算機上運行,​​並且發佈服務器隊列在本地創建。 =>用戶正在其上運行的機器相同。 – singhsa 2011-02-10 01:50:34

回答

0

檢查發佈服務器上的內部出站隊列。如果您看到消息,則表示無法與訂閱服務器通信。這通常意味着您可能沒有運行MSDTC或未正確配置MSDTC的安全性。確保在MSDTC安全設置中設置了「允許入站」和「允許出站」。

+0

只是爲了確認,在發佈商的內部出站隊列是MsmqTransportConfig即下 我啓用了Journalling,當發佈者啓動時,我可以在日記隊列中看到最初的消息,但我沒有看到後續消息。我檢查了MSDTC,它配置正確。 – singhsa 2011-02-10 15:27:57

0

我想在我的工作中將我的鼠標夾在某人身上。

對我來說,問題是我試圖發送一個普通的poco類作爲我的消息。
的app.config

<UnicastBusConfig ForwardReceivedMessagesTo="audit"> 
    <MessageEndpointMappings> 
     <add Assembly="Messages" Endpoint="pub" /> 
    </MessageEndpointMappings> 
    </UnicastBusConfig> 

後來我想也許我需要告訴什麼對象應該是,所以我配置的消息作爲消息

Configure.With() 
.DefiningMessagesAs(t => t.Namespace != null && t.Namespace.Contains("Messages")); 

仍然沒有工作,所以然後咧嘴一笑我改成了這個

Configure.With() 
.DefiningEventsAs(t => t.Namespace != null && t.Namespace.Contains("Messages")); 

現在它工作正常