Esempio n. 1
0
        public void Bind(RabbitMqConnection connection)
        {
            using (var management = new RabbitMqEndpointManagement(_address, connection.Connection))
            {
                management.BindQueue(_address.Name, _address.Name, ExchangeType.Fanout, "", _address.QueueArguments());

                if (_purgeOnBind)
                {
                    management.Purge(_address.Name);
                    _purgeOnBind = false;
                }
            }

            _channel = connection.Connection.CreateModel();
            _channel.BasicQos(0, 1, false);
        }
		static void PurgeExistingMessages(ConnectionHandler<RabbitMqConnection> connectionHandler,
		                                  IRabbitMqEndpointAddress address)
		{
			connectionHandler.Use(connection =>
				{
					using (var management = new RabbitMqEndpointManagement(address, connection.Connection))
					{
						management.Purge(address.Name);
					}
				});
		}