问题:订阅者无法从发布者接收事件,因为发布者和订阅者使用不同的传输。发布者和订阅者在同一台服务器上运行。
Publisher – NServiceBus 3.0 使用 MSMQ 传输
订阅者——使用 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