public Binding(Queue queue, DirectExchange exchange) { this.queue = queue.Name; this.exchange = exchange.Name; this.routingKey = ""; }
public DirectExchangeRoutingKeyConfigurer To(DirectExchange directExchange) { return new DirectExchangeRoutingKeyConfigurer(this.queue, directExchange); }
public void TestSpringWithDefaultExchangeNonImplicitBinding() { var exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME); this.context.ObjectFactory.RegisterSingleton("foo", exchange); var queueName = "test.queue"; var queue = new Queue(queueName, false, false, false); this.context.ObjectFactory.RegisterSingleton("bar", queue); var binding = new Binding(queueName, Binding.DestinationType.Queue, exchange.Name, "test.routingKey", null); this.context.ObjectFactory.RegisterSingleton("baz", binding); this.rabbitAdmin.AfterPropertiesSet(); try { this.rabbitAdmin.DeclareBinding(binding); } catch (AmqpIOException ex) { Exception cause = ex; Exception rootCause = null; while (cause != null) { rootCause = cause; cause = cause.InnerException; } Assert.True(rootCause.Message.Contains("code=403")); Assert.True(rootCause.Message.Contains("operation not permitted on the default exchange")); } }
public Binding(Queue queue, DirectExchange exchange, String routingKey) { this.queue = queue.Name; this.exchange = exchange.Name; this.routingKey = routingKey; }
public void TestSpringWithDefaultExchangeImplicitBinding() { var exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME); this.context.ObjectFactory.RegisterSingleton("foo", exchange); var queueName = "test.queue"; var queue = new Queue(queueName, false, false, false); this.context.ObjectFactory.RegisterSingleton("bar", queue); var binding = new Binding(queueName, Binding.DestinationType.Queue, exchange.Name, queueName, null); this.context.ObjectFactory.RegisterSingleton("baz", binding); this.rabbitAdmin.AfterPropertiesSet(); this.rabbitAdmin.Initialize(); // Pass by virtue of RabbitMQ not firing a 403 reply code for both exchange and binding declaration Assert.True(this.QueueExists(queue)); }
public void TestDeclareBindingWithDefaultExchangeImplicitBinding() { var exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME); var queueName = "test.queue"; var queue = new Queue(queueName, false, false, false); this.rabbitAdmin.DeclareQueue(queue); var binding = new Binding(queueName, Binding.DestinationType.Queue, exchange.Name, queueName, null); this.rabbitAdmin.DeclareBinding(binding); // Pass by virtue of RabbitMQ not firing a 403 reply code for both exchange and binding declaration Assert.True(this.QueueExists(queue)); }
public void TestSpringWithDefaultExchange() { var exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME); this.context.ObjectFactory.RegisterSingleton("foo", exchange); this.rabbitAdmin.AfterPropertiesSet(); this.rabbitAdmin.Initialize(); // Pass by virtue of RabbitMQ not firing a 403 reply code }
public void TestDeclareExchangeWithDefaultExchange() { var exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME); this.rabbitAdmin.DeclareExchange(exchange); // Pass by virtue of RabbitMQ not firing a 403 reply code }
/// <summary>The to.</summary> /// <param name="exchange">The exchange.</param> /// <returns>The direct exchange routing key configurer.</returns> public DirectExchangeRoutingKeyConfigurer To(DirectExchange exchange) { return(new DirectExchangeRoutingKeyConfigurer(this, exchange)); }