コード例 #1
0
ファイル: BigBubbleClient.cs プロジェクト: umunu/BigBubbleRmq
        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
ファイル: Publisher.cs プロジェクト: umunu/BigBubbleRmq
        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
ファイル: Consumer.cs プロジェクト: umunu/BigBubbleRmq
 public Consumer(IRmqConnectionFactory connectionFactory, IUsernameProvider username)
 {
     _consumerChannel = connectionFactory.GetPublishChannel();
     _username        = username;
 }