我们使用 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();
}
}
有想法该怎么解决这个吗?
这是日志信息(那里有很多,搜索错误以查看相关部分)