Beispiel #1
0
        public async Task StartConsumeAsync()
        {
            RMQConnector rmq = new RMQConnector(rmq_host, rmq_port, rmq_vhost, rmq_login, rmq_password, rmq_queue);

            Assert.IsTrue(rmq.Connect());

            OneCConnector oneC = new OneCConnector(oneC_server, oneC_baseName, oneC_login, oneC_password);

            Assert.IsTrue(oneC.Connect());

            Channel <Message> messages = Channel.CreateUnbounded <Message>();
            Channel <Message> acks     = Channel.CreateUnbounded <Message>();

            try
            {
                rmq.StartConsume(messages, acks);
                await oneC.StartConsumeAsync(messages, acks);
            }
            catch { }
            finally
            {
                rmq.Close();
                oneC.Close();
                messages.Writer.Complete();
                acks.Writer.Complete();
            }
        }
Beispiel #2
0
        public void OneC_Connect()
        {
            OneCConnector oneCConnector = new OneCConnector(oneC_server, oneC_baseName, oneC_login, oneC_password);
            bool          isConnected   = oneCConnector.Connect();

            Assert.IsTrue(isConnected);

            bool isClosed = oneCConnector.Close();

            Assert.IsTrue(isClosed);
        }