我有以下行来获取IHandleMessages<>中的邮件头类
IDictionary<string, string> headers = _bus.CurrentMessageContext.Headers;
我收到错误消息
总线未实现IManageMessageHeaders
我原以为这是默认配置的。有谁知道如何实现IManageMessageHeaders?我是否需要更改端点的配置方式?
public class EndpointConfig : IConfigureThisEndpoint
{
public void Customize(BusConfiguration configuration)
{
configuration.UsePersistence<InMemoryPersistence>();
ConfigureLog4Net();
}
private void ConfigureLog4Net()
{
log4net.Config.XmlConfigurator.Configure();
var layout = new PatternLayout
{
ConversionPattern = "%d [%t] %-5p %c [%x] - %m%n"
};
layout.ActivateOptions();
var consoleAppender = new ColoredConsoleAppender
{
Threshold = Level.Debug,
Layout = layout
};
consoleAppender.ActivateOptions();
BasicConfigurator.Configure(consoleAppender);
LogManager.Use<Log4NetFactory>();
}
}
我使用NServiceBus Host 6.0.0,NServiceBus 5.1.2。