Пример #1
0
        public BigBubbleClient(Publisher publisher, Consumer consumer, IUsernameProvider usernameProvider, IConfiguration config, IRmqConnectionFactory connectionFactory)
        {
            _publisher = publisher;
            _consumer  = consumer;

            _consumer.MessageReceived += Consumer_MessageReceived;

            _usernameProvider  = usernameProvider;
            _connectionFactory = connectionFactory;
        }
Пример #2
0
        public Publisher(IRmqConnectionFactory connectionFactory, IUsernameProvider username)
        {
            _publishChannel = connectionFactory.GetPublishChannel();
            _queueName      = _publishChannel.QueueDeclare().QueueName;

            _publishChannel.QueueBind(queue: _queueName,
                                      exchange: "chat_fnt",
                                      routingKey: "");
            _basicProperties            = _publishChannel.CreateBasicProperties();
            _basicProperties.Persistent = true;
            _basicProperties.Headers    = new Dictionary <string, object>();
            //_basicProperties.Headers.Add("nickname", username.GetUsername());
        }
Пример #3
0
 public Consumer(IRmqConnectionFactory connectionFactory, IUsernameProvider username)
 {
     _consumerChannel = connectionFactory.GetPublishChannel();
     _username        = username;
 }