- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想弄清楚如何将 NServiceBus 与 Common.Logging 结合使用。我只是无法让它运行。我尝试开发一个仅用于教育目的的小型演示应用程序。
我所做的是:
1) 创建一个简单的控制台应用程序并导入 Common.Logging 和 Common,Logging.NLog,添加一些 Info 消息并添加一个 App.Config 文件:
<configuration>
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
<arg key="level" value="DEBUG" />
<arg key="showLogName" value="true" />
<arg key="showDataTime" value="true" />
<arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
</factoryAdapter>
</logging>
</common>
</configuration>
var bus = Configure.With().DefaultBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional( true )
.UnicastBus()
.MsmqSubscriptionStorage()
.CreateBus()
.Start( () => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install() );
System.TypeInitializationException was unhandled
Message=The type initializer for 'NServiceBus.Configure' threw an exception.
Source=NServiceBus.Core
TypeName=NServiceBus.Configure
StackTrace:
at NServiceBus.Configure.With()
at ConsoleApplication1.Program.Main(String[] args) in D:\Development\katas\ConsoleApplication1\ConsoleApplication1\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: Common.Logging.ConfigurationException
Message=ConfigurationReader Common.Logging.Configuration.DefaultConfigurationReader returned unknown settings instance of type Common.Logging.Configuration.LogSetting
Source=NServiceBus.Core
StackTrace:
at Common.Logging.Configuration.ArgUtils.Guard[T](Function`1 function, String messageFormat, Object[] args)
at Common.Logging.Configuration.ArgUtils.Guard(Action action, String messageFormat, Object[] args)
at Common.Logging.LogManager.BuildLoggerFactoryAdapter()
at Common.Logging.LogManager.get_Adapter()
at Common.Logging.LogManager.GetLogger(String name)
at NServiceBus.Configure..cctor()
InnerException: System.ArgumentOutOfRangeException
Message=Type 'Common.Logging.Configuration.LogSetting, Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e' of parameter 'sectionResult' is not assignable to target type 'Common.Logging.Configuration.LogSetting, NServiceBus.Core, Version=3.2.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c'
Parameter name: sectionResult
Actual value was Common.Logging.Configuration.LogSetting.
Source=NServiceBus.Core
ParamName=sectionResult
StackTrace:
at Common.Logging.Configuration.ArgUtils.AssertIsAssignable[T](String paramName, Type valType, String messageFormat, Object[] args)
at Common.Logging.Configuration.ArgUtils.AssertIsAssignable[T](String paramName, Type valType)
at Common.Logging.LogManager.<>c__DisplayClass3.<BuildLoggerFactoryAdapter>b__1()
at Common.Logging.Configuration.ArgUtils.<>c__DisplayClass13.<Guard>b__12()
at Common.Logging.Configuration.ArgUtils.Guard[T](Function`1 function, String messageFormat, Object[] args)
InnerException:
最佳答案
NServiceBus 有它自己的 Common.Logging 版本,它被合并并内化到 Core dll 中,它用来配置它自己的日志记录(使用 log4net)。当它启动时,它会发现 app.config 中的配置部分并尝试加载它。但是,您的配置部分(称为“日志记录”)指向外部 Common.Logging dll:
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, NServiceBus.Core" />
关于NServiceBus + Common.Logging + NLog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11115376/
current advice on handling exceptions in NServiceBus是使用内置的设施。错误消息进入错误消息队列,并将日志写入磁盘。 但是,如果我想将我的错误发送到
我们正试图找出用于我们的 NServiceBus 服务的最佳线程数。我们在一台有 2 个四核的机器上运行它。我们在队列备份方面遇到了问题。我们从 100 个线程开始,然后增加到 200 个,事情变得更
我有一个现有的 NServiceBus 2.6 应用程序,我想开始迁移到 3.0。我正在寻找第一个实例的最小更改升级。这就像用 3.0 Nuget 包替换 2.6 DLL 一样简单,还是有其他考虑?
是否可以在 NServiceBus 版本 3.2.2 中禁用重试? 使用以下配置,可以禁用重试: 但当线程数设置为 20 时则不会。在这种情况下,消息会重试两次: 这看起来很像
NServiceBus 的“重试”系统很棒。它在确保像死锁这样的小事情不会把我们搞砸方面非常有效。 但是,有时我知道一条消息是不好的。从某种意义上说,再多的重试也无济于事。 有没有办法告诉 NServ
使用 NEventStore 时如何集成到 NServiceBus? 我是 NSB ans ES 的新手,并试图在使用 ES 和 CQRS 时找出 NSB 的最佳设置。 我以与示例中的 Dispatc
我刚刚开始使用 NServiceBus,无法弄清楚在代码中配置 MsmqTransport 时缺少什么。如果我这样配置发布者; IBus bus = Configure.With()
遵循此解释的最简单方法是 NServiceBus Pub/Sub 示例,其中包含“多态订阅”示例 (Subscriber2)。 消息:(未更改) public class EventMessage :
Udi 和 Andreas 多次提到 NServiceBus 安装的零停机升级。对 NServiceBus 安装执行零停机升级的正确方法是什么? 最佳答案 这意味着,由于 NSB 使用消息传递作为底层
我有一个场景,我需要通过一个简单的经过身份验证的 REST API 向第三方公开一堆在 NServiceBus 中创建的事件消息。第三方可能使用也可能不使用 .NET(它们甚至可能是浏览器中的 Jav
假设我使用延迟消息传递功能在将来的某个时间点发送消息,但稍后我可能想取消该消息。 问题 1 - 进行原始 bus.Defer(...) 调用时,如何为该消息取回唯一标识符?我希望有消息 ID 或某种超
背景 我们正在尝试在我们的公司中引入一种新的架构模式,并且正在考虑使用服务总线的具有事件源的 CQRS。我们目前正在开发 POC 的技术是 NServiceBus、事件存储和 MSMQ。我们希望在 N
NServiceBus 到底是 ESB 还是轻量级 ESB?还是更像具有持久/可靠消息传递的 WCF?在我看来,它更像是一个消息传递框架而不是 ESB。 只是想要一些指针,因为我刚刚开始研究不同的 E
我正在尝试将 NServiceBus 设置为使用远程错误队列来简化错误检查的管理。当我这样做时,我在 NServiceBus.Host.exe 启动时收到以下错误: 2010-03-25 07:59:
我知道这对很多人来说似乎很明显,但我的客户使用的模式我不太方便。 案例是,他们的客户通过 nservicebus 将存款或取款发送到第三方系统。第三方系统需要处理该交易,但可能需要数天,甚至数周才能完
有没有办法禁止将失败的消息发送到 NServiceBus 的错误队列? 对于一个特定的端点,我不想在二级重试失败后重试消息。相反,我将使用此处提到的 MessageSentToErrorQueue 错
我遇到了与重试相关的行为,在我尝试过的文档或搜索中找不到任何引用。基本上,如果我的处理程序处理消息的时间超过 60 秒(注意它不会引发异常),NServiceBus 会触发另一个处理程序来处理相同的消
我有一个需要以同步方式调用 nservicebus 的 Web 服务。 如何做到这一点? 最佳答案 查看 AsyncPages 示例。如果您希望它是同步的,只需阻塞直到回调完成。 希望这可以帮助! 关
我想创建一个由消息“Event1”开始的传奇,但它会忽略收到具有相同应用 ID 的“重复”开始消息(这可能是由于两个或多个用户在短时间内点击了 UI 按钮) .文档似乎表明这种方法可行: 佐贺声明 I
过去 6 个月的学习曲线充满挑战,CQRS 和 DDD 是罪魁祸首。 这很有趣,我们已经完成了项目的 1/2,而我还没有时间深入研究的领域是消息传递框架。 目前我不使用 DTC,所以有一个很好的可能性
我是一名优秀的程序员,十分优秀!