コード例 #1
0
        /// <summary>
        /// See <see cref="Feature.Setup" />
        /// </summary>
        protected internal override void Setup(FeatureConfigurationContext context)
        {
            string basePath;
            if (!context.Settings.TryGet("FileShareDataBusPath", out basePath))
            {
                throw new InvalidOperationException("Specify the basepath for FileShareDataBus, eg endpointConfiguration.UseDataBus<FileShareDataBus>().BasePath(\"c:\\databus\")");
            }
            var dataBus = new FileShareDataBusImplementation(basePath);

            context.Container.RegisterSingleton<IDataBus>(dataBus);
        }
コード例 #2
0
        /// <summary>
        /// See <see cref="Feature.Setup"/>
        /// </summary>
        protected internal override void Setup(FeatureConfigurationContext context)
        {
            // We still doing this check here eventhough we now have an explicit API
            // to register custom IDataBus implementations for backwards compatibility
            Type dataBusDefinitionType;
            var customDataBusComponentRegistered = context.Container.HasComponent<IDataBus>();

            if (!context.Settings.TryGet("dataBusDefinitionType", out dataBusDefinitionType) && !customDataBusComponentRegistered)
            {
                string basePath;
                if (!context.Settings.TryGet("FileShareDataBusPath", out basePath))
                {
                    throw new InvalidOperationException("Messages containing databus properties found, please configure a databus using the ConfigureFileShareDataBus.FileShareDataBus extension method for ConfigurationBuilder.");
                }
                var dataBus = new FileShareDataBusImplementation(basePath);

                context.Container.RegisterSingleton<IDataBus>(dataBus);
            }
        }
コード例 #3
0
ファイル: AcceptanceTests.cs プロジェクト: xqfgbc/NServiceBus
 public void SetUp()
 {
     dataBus = new FileShareDataBusImplementation(basePath) {MaxMessageTimeToLive = TimeSpan.MaxValue};
 }