コード例 #1
0
        MqQueueFactory CreateQueueFactory(string namePrefix = null)
        {
            var connProvider = new DefaultMqConnectionProvider(TestMqTools.Load());

            return(new MqQueueFactory(new DefaultMqChannelProvider(connProvider))
            {
                Prefix = namePrefix,
                AutoDelete = true
            });
        }
コード例 #2
0
        MqExchangeFactory CreateExchangeFactory(string namePrefix = null)
        {
            var connProvider = new DefaultMqConnectionProvider(TestMqTools.Load());
            var chProvider   = new DefaultMqChannelProvider(connProvider);

            return(new MqExchangeFactory(MqExchangeType.Fanout, chProvider)
            {
                Prefix = namePrefix,
                AutoDelete = true
            });
        }
コード例 #3
0
ファイル: MqExchangeBehavior.cs プロジェクト: mylab-tools/mq
        public void ShouldFailIfExchangeNotExists()
        {
            //Arrange
            var exchangeName = Guid.NewGuid().ToString("N");
            var connProvider = new DefaultMqConnectionProvider(TestMqTools.Load());
            var chProvider   = new DefaultMqChannelProvider(connProvider);
            var exchange     = new MqExchange(exchangeName, chProvider);

            //Act
            var exists = exchange.IsExists();

            //Assert
            Assert.False(exists);
        }
コード例 #4
0
 IMqPublisher CreateTestPublisher(IAppStatusService appStatusService = null) => new DefaultMqPublisher(
     new DefaultMqChannelProvider(new DefaultMqConnectionProvider(TestMqTools.Load())),
     null, appStatusService);