NServiceBus Pub / Sub使用不同的传输

时间:2013-08-21 19:33:54

标签: nservicebus publish-subscribe

问题:订阅者无法从发布者接收活动,因为发布者和订阅者正在使用不同的传输。 Publisher和Subscriber在同一台服务器上运行。

发布商 - 使用MSMQ传输的NServiceBus 3.0

订阅者 - 使用MSSql传输的NserviceBus 4.0

错误

Failed to subscribe to NServiceBus.Unicast.Queuing.QueueNotFoundException: Failed to send message to address: [publisher] ---> System.Data.SqlClient.SqlException: Invalid object name '......publisher'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, Run Behavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, BooleanasyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at NServiceBus.Transports.SQLServer.SqlServerMessageSender.ExecuteQuery(TransportMessage message, SqlCommand command) in c:\TeamCity\buildAgent\work\d4de8921a0aabf04\src\SqlServer\NServiceBus.SqlServer\SqlServerMessageSender.cs:line 150   at NServiceBus.Transports.SQLServer.SqlServerMessageSender.Send(TransportMessage message, Address address) in c:\TeamCity\buildAgent\work\d4de8921a0aabf04\src\SqlServer\NServiceBus.SqlServer\SqlServerMessageSender.cs:line 71
--- End of inner exception stack trace ---
at NServiceBus.Transports.SQLServer.SqlServerMessageSender.Send(TransportMessage message, Address address) in c:\TeamCity\buildAgent\work\d4de8921a0aabf04\src\SqlServer\NServiceBus.SqlServer\SqlServerMessageSender.cs:line 87   at NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions.MessageDriven SubscriptionManager.SendMessage(Address publisherAddress, TransportMessage subscriptionMessage) in c:\TeamCity\buildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unicast\Subscriptions\MessageDrivenSubscriptions\MessageDrivenSubscriptionManager.cs:line 149
at NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions.MessageDrivenSubscriptionManager.SendSubscribeMessageWithRetries(Address destination, TransportMessage subscriptionMessage, String messageType, Int32 retriesCount) in c:\TeamCity\buildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unicast\Subscriptions\MessageDrivenSubscriptions\MessageDrivenSubscriptionManager.cs:line 156 at publisher queue ...FeedAvailable, .....Messages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

1 个答案:

答案 0 :(得分:1)

在执行发布/订阅,请求/响应等时,您需要双方使用相同的传输。