Esempio n. 1
0
        static void Configure(StandardConfigurer <ITransport> configurer, Func <IRebusLoggerFactory, OracleConnectionHelper> connectionProviderFactory, string tableName, string inputQueueName, bool automaticallyCreateTables = true)
        {
            configurer.Register(context =>
            {
                var rebusLoggerFactory = context.Get <IRebusLoggerFactory>();
                var asyncTaskFactory   = context.Get <IAsyncTaskFactory>();
                var rebusTime          = context.Get <IRebusTime>();
                var connectionProvider = connectionProviderFactory(rebusLoggerFactory);
                var transport          = new OracleTransport(connectionProvider, tableName, inputQueueName, rebusLoggerFactory, asyncTaskFactory, rebusTime);

                if (automaticallyCreateTables)
                {
                    transport.EnsureTableIsCreated();
                }

                return(transport);
            });

            configurer.OtherService <ITimeoutManager>().Register(c => new DisabledTimeoutManager());

            configurer.OtherService <IPipeline>().Decorate(c =>
            {
                var pipeline = c.Get <IPipeline>();

                return(new PipelineStepRemover(pipeline)
                       .RemoveIncomingStep(s => s.GetType() == typeof(HandleDeferredMessagesStep)));
            });
        }
Esempio n. 2
0
        public ITransport Create(string inputQueueAddress)
        {
            var consoleLoggerFactory = new ConsoleLoggerFactory(false);
            var connectionHelper     = new OracleConnectionHelper(OracleTestHelper.ConnectionString);
            var asyncTaskFactory     = new TplAsyncTaskFactory(consoleLoggerFactory);
            var transport            = new OracleTransport(connectionHelper, _tableName, inputQueueAddress, consoleLoggerFactory, asyncTaskFactory, _fakeRebusTime);

            _disposables.Add(transport);

            transport.EnsureTableIsCreated();
            transport.Initialize();

            return(transport);
        }
Esempio n. 3
0
        protected override void SetUp()
        {
            var consoleLoggerFactory = new ConsoleLoggerFactory(false);
            var asyncTaskFactory     = new TplAsyncTaskFactory(consoleLoggerFactory);
            var connectionHelper     = new OracleFactory(OracleTestHelper.ConnectionString);

            _transport = new OracleTransport(connectionHelper, _tableName, QueueName, consoleLoggerFactory, asyncTaskFactory, new FakeRebusTime());
            _transport.EnsureTableIsCreated();

            Using(_transport);

            _transport.Initialize();
            _cancellationToken = new CancellationTokenSource().Token;
        }
        public ITransport Create(string inputQueueAddress)
        {
            var tableName = ("rebus_messages_" + TestConfig.Suffix).TrimEnd('_');

            _tablesToDrop.Add(tableName);

            var consoleLoggerFactory = new ConsoleLoggerFactory(false);
            var connectionHelper     = new OracleConnectionHelper(OracleTestHelper.ConnectionString);
            var asyncTaskFactory     = new TplAsyncTaskFactory(consoleLoggerFactory);
            var transport            = new OracleTransport(connectionHelper, tableName, inputQueueAddress, consoleLoggerFactory, asyncTaskFactory);

            _disposables.Add(transport);

            transport.EnsureTableIsCreated();
            transport.Initialize();

            return(transport);
        }
Esempio n. 5
0
        static OracleTransport GetTransport()
        {
            var loggerFactory      = new ConsoleLoggerFactory(false);
            var connectionProvider = new OracleConnectionHelper(OracleTestHelper.ConnectionString);
            var asyncTaskFactory   = new TplAsyncTaskFactory(loggerFactory);

            var transport = new OracleTransport(
                connectionProvider,
                TableName,
                QueueName,
                loggerFactory,
                asyncTaskFactory
                );

            transport.EnsureTableIsCreated();
            transport.Initialize();

            return(transport);
        }