예제 #1
0
        public void TestRoundRobin()
        {
            string tp1_serviceBusConnectionString = "Endpoint=sb://hk-hack-hub-ns.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=JhDUJn307X1JEoPZb4aw0ZxYRz9cOdp4ZbnWS/Gm2Lc=;TransportType=Amqp";
            string connectionString = tp1_serviceBusConnectionString;
            SBMessagingFactoryWithConnectionString cst = new SBMessagingFactoryWithConnectionString(connectionString);

            ServiceBus.ConnectionPool.ConnectionPool <MessagingFactory> sbp = new ServiceBus.ConnectionPool.ConnectionPool <MessagingFactory>(cst, 10);
            sbp.Initialize();
            MessagingFactory mf1 = sbp.GetNext();
            MessagingFactory mf2 = sbp.GetNext();

            Assert.AreNotEqual(mf1, null);
            Assert.AreNotEqual(mf2, null);
            Assert.AreNotEqual(mf1.GetHashCode(), mf2.GetHashCode());
        }