Exemple #1
0
        public RabbitMqClient Consumer <T>(ConnectionFactory factory, string queueName, T consumer, bool noAck, string tag) where T : IBaseConsumer
        {
            RabbitMqClient client = new RabbitMqClient(factory.UserName, factory.Password, factory.HostName, factory.VirtualHost, factory.Port, tag);

            Clients.Add(client);
            client.Index = Clients.Count;
            client.Consumer(factory, queueName, consumer, noAck);
            return(client);
        }
Exemple #2
0
        public RabbitMqClient Publish(ConnectionFactory factory, int index, string tag, string fileName = "")
        {
            RabbitMqClient client = new RabbitMqClient(factory.UserName, factory.Password, factory.HostName, factory.VirtualHost, factory.Port, tag);

            Clients.Add(client);
            client.Index = index;
            client.Publish(factory, fileName);

            return(client);
        }
Exemple #3
0
        public RabbitMqClient Publish(string uri, int index, string cached = "")
        {
            RabbitMqClient client = new RabbitMqClient(uri);

            Clients.Add(client);
            client.Index = index;
            client.Publish(new ConnectionFactory
            {
                Uri = new Uri(uri)
            }, cached);

            return(client);
        }