コード例 #1
0
 private void SetUp()
 {
     _connectionSettings = ConnectionSettings.Instance("127.0.0.1", 5672, "rabbitMQSamples", "colin", "123456");
     _phoneNumberExecutive = new PhoneNumberExecutive(_connectionSettings);
     _phoneNumberFinder = new PhoneNumberFinder(_connectionSettings);
     _matchtedPhoneNumberCounter = new MatchtedPhoneNumberCounter(_connectionSettings);
     _totalPhoneNumbersCounter = new TotalPhoneNumbersCounter(_connectionSettings);
 }
コード例 #2
0
        protected BrokerChannel(ConnectionSettings connectionSettings, string name)
        {
            this.Name = name;
            ConnectionFactory factory = this.ConfigureConnectionFactoryUsing(connectionSettings);

            this._connection = factory.CreateConnection();
            this.Channel = this._connection.CreateModel();
        }
コード例 #3
0
        public Queue(ConnectionSettings connectionSettings, string name, bool durable, bool exclusive, bool autoDeleted)
            : base(connectionSettings)
        {
            this.Durable = durable;

            QueueDeclareOk result = this.Channel.QueueDeclare(name, durable, exclusive, autoDeleted, null);

            this.Name = result.QueueName;
        }
コード例 #4
0
 public static Queue DurableInstance(ConnectionSettings connectionSettings, string name)
 {
     return new Queue(connectionSettings, name, true, false, false);
 }
コード例 #5
0
 public static Queue Create(ConnectionSettings connectionSettings, string name, bool durable, bool exclusive,
     bool autoDeleted)
 {
     return new Queue(connectionSettings, name, durable, exclusive, autoDeleted);
 }
コード例 #6
0
 public static Queue Create(ConnectionSettings connectionSettings, string name)
 {
     return new Queue(connectionSettings, name, false, false, false);
 }
コード例 #7
0
 public MatchtedPhoneNumberCounter(ConnectionSettings connectionSettings)
     : base(connectionSettings)
 {
 }
コード例 #8
0
 public TotalPhoneNumbersCounter(ConnectionSettings connectionSettings)
     : base(connectionSettings)
 {
 }
コード例 #9
0
 public PhoneNumberFinder(ConnectionSettings connectionSettings)
     : base(connectionSettings)
 {
 }
コード例 #10
0
 public PhoneNumberExecutive(ConnectionSettings connectionSettings)
     : base(connectionSettings)
 {
     this._processes = new Dictionary<string, PhoneNumberProcess>();
 }
コード例 #11
0
 protected ExchangeListener(ConnectionSettings connectionSettings)
 {
     this._connectionSettings = connectionSettings;
     this.AttachToQueue();
     this.RegisterConsumer();
 }
コード例 #12
0
        protected ConnectionFactory ConfigureConnectionFactoryUsing(ConnectionSettings connectionSettings)
        {
            ConnectionFactory factory = new ConnectionFactory();

            factory.HostName = connectionSettings.HostName;

            if(connectionSettings.HasPort()) {
                factory.Port = connectionSettings.Port;
            }

            factory.VirtualHost = connectionSettings.VirtualHost;

            if(connectionSettings.HasUserCredentials()) {
                factory.UserName = connectionSettings.UserName;
                factory.Password = connectionSettings.Password;
            }

            return factory;
        }
コード例 #13
0
 protected BrokerChannel(ConnectionSettings connectionSettings)
     : this(connectionSettings, null)
 {
 }