C# 订阅服务器未读取事件消息
我有一个基于NServiceBus的小型服务,用于监听其他地方发生的某些事件。端点配置类看起来像:C# 订阅服务器未读取事件消息,c#,msmq,nservicebus,publish-subscribe,C#,Msmq,Nservicebus,Publish Subscribe,我有一个基于NServiceBus的小型服务,用于监听其他地方发生的某些事件。端点配置类看起来像: public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization { public void Init() { var container = new WindsorContainer(); try {
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization
{
public void Init()
{
var container = new WindsorContainer();
try
{
SetLoggingLibrary.Log4Net(() => XmlConfigurator.Configure());
Configure.Serialization.Xml();
Configure.Features.Enable<Sagas>();
Configure.With()
.CastleWindsorBuilder(container)
.DefiningCommandsAs(t =>
t.GetCustomAttributes(typeof(CustomCommandAttribute), false)
.GetLength(0) > 0)
.DefiningEventsAs(t =>
t.GetCustomAttributes(typeof(CustomEventAttribute), false)
.GetLength(0) > 0)
.Log4Net()
.UseNHibernateTimeoutPersister()
.UseNHibernateSagaPersister()
;
}
catch (Exception ex)
{
throw new Exception("Configuration did not work. " + Environment.NewLine +
string.Format("Config file: {0}", AppDomain.CurrentDomain.SetupInformation.ConfigurationFile) +
Environment.NewLine +
ex.Message, ex);
}
//More stuff adding other non-NSB facilities into the container.
//Pretty certain it's not relevant here, but if people think it is it can be added
}
}
此后,发布者发布了4条此类消息,我可以在mysubscribermachine
上的MySubscriber
队列中看到4条消息。然后-什么也没发生
我们的log4net配置将NServiceBus记录为DEBUG
级别-因此,例如,我看到同一个服务每分钟都在轮询NSB超时-但我没有看到任何关于它的信息,甚至尝试使用这些消息并调用处理程序
此时如何才能获得更好的诊断信息
NServiceBus的版本为4.3。服务器是Windows Server 2008 R2。显然,如果运行服务的用户帐户没有访问其自己队列的权限,则不值得向日志中发送任何内容
我们已授予帐户从队列中读取的权限,现在它运行正常。您的NSB发布服务器是什么版本?您提到的4.3,是针对发布者和订阅者的吗?您是否对消息使用不引人注目的约定?订户日志中有什么内容吗?你能为订阅服务器添加app.config吗?@InduAlagarsamy-原来是权限问题-但没有,订阅服务器日志中没有任何内容-我们目前已将其设置为
调试
级别的日志。
SubscriberEndpoint MessageType Version TypeName
----------------------------------- -------------------------------------- ------------- ---------------------------
MySubscriber@MySubscribersMachine Namespaces.PrincipalAdded,1.1.3.37147 1.1.3.37147 Namespaces.PrincipalAdded