我们将NServicebus 4.0.5与sql server(sql server 2012)一起用作传输。当处理程序抛出异常时,NSB不会重试或将消息移动到错误队列。成功的消息使它成为 审计队列但失败/错误的队列没有! 。有趣的是,所有这些都适用于我们的本地机器(Windows 7,sql server localdb),但不适用于Windows Server 2012(sql server 2012)。以下是订户的配置信息:
<add name="NServiceBus/Transport" connectionString="Data Source=xxx;Initial
Catalog=NServiceBus;Integrated Security=SSPI;Enlist=false;" />
<add name="NServiceBus/Persistence" connectionString="Data
Source=xxx;Initial Catalog=NServiceBus;Integrated
Security=SSPI;Enlist=false;" />
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
<UnicastBusConfig ForwardReceivedMessagesTo="audit">
<MessageEndpointMappings>
<add Assembly="Services.Section.Messages" Endpoint=
"Services.ACL.Worker" />
</MessageEndpointMappings>
</UnicastBusConfig>
在代码中,它配置如下:
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server,
IWantCustomInitialization
{
public void Init()
{
IContainer container = ContainerInstanceProvider.
GetContainerInstance();
Configure
.Transactions.Enable();
Configure.With()
.AutofacBuilder(container)
.UseTransport<SqlServer>()
.Log4Net()
//.Serialization.Json()
.UseNHibernateSubscriptionPersister()
.UseNHibernateTimeoutPersister()
.MessageForwardingInCaseOfFault()
.RijndaelEncryptionService()
.DefiningCommandsAs(type => type.Namespace != null &&type
.Namespace.EndsWith("Commands"))
.DefiningEventsAs(type => type.Namespace != null &&type
.Namespace.EndsWith("Events"))
.UnicastBus();
}
}
有关如何解决此问题的任何想法?
这里是日志信息(那里有很多,搜索错误以查看相关部分)