Examples of DirectExchange


Examples of org.springframework.amqp.core.DirectExchange

      return queue;
    }

    @Bean
    public Exchange exchange() throws IOException {
      DirectExchange exchange = new DirectExchange("bar");
      exchange.setAdminsThatShouldDeclare(admin1());
      return exchange;
    }
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

    connectionFactory.destroy();
  }

  @Test
  public void testDeclareExchangeWithDefaultExchange() throws Exception {
    Exchange exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME);

    rabbitAdmin.declareExchange(exchange);

    // Pass by virtue of RabbitMQ not firing a 403 reply code
  }
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

    // Pass by virtue of RabbitMQ not firing a 403 reply code
  }

  @Test
  public void testSpringWithDefaultExchange() throws Exception {
    Exchange exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME);
    context.getBeanFactory().registerSingleton("foo", exchange);
    rabbitAdmin.afterPropertiesSet();

    rabbitAdmin.initialize();
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

    assertTrue(result);
  }

  @Test
  public void testDeclareBindingWithDefaultExchangeImplicitBinding() throws Exception {
    Exchange exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME);
    String queueName = "test.queue";
    final Queue queue = new Queue(queueName, false, false, false);
    rabbitAdmin.declareQueue(queue);
    Binding binding = new Binding(queueName, DestinationType.QUEUE, exchange.getName(), queueName, null);

    rabbitAdmin.declareBinding(binding);

    // Pass by virtue of RabbitMQ not firing a 403 reply code for both exchange and binding declaration
    assertTrue(queueExists(queue));
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

    assertTrue(queueExists(queue));
  }

  @Test
  public void testSpringWithDefaultExchangeImplicitBinding() throws Exception {
    Exchange exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME);
    context.getBeanFactory().registerSingleton("foo", exchange);
    String queueName = "test.queue";
    final Queue queue = new Queue(queueName, false, false, false);
    context.getBeanFactory().registerSingleton("bar", queue);
    Binding binding = new Binding(queueName, DestinationType.QUEUE, exchange.getName(), queueName, null);
    context.getBeanFactory().registerSingleton("baz", binding);
    rabbitAdmin.afterPropertiesSet();

    rabbitAdmin.initialize();
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

    // Pass by virtue of RabbitMQ not firing a 403 reply code
  }

  @Test
  public void testDeclareBindingWithDefaultExchangeNonImplicitBinding() throws Exception {
    Exchange exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME);
    String queueName = "test.queue";
    final Queue queue = new Queue(queueName, false, false, false);
    rabbitAdmin.declareQueue(queue);
    Binding binding = new Binding(queueName, DestinationType.QUEUE, exchange.getName(), "test.routingKey", null);

    try {
      rabbitAdmin.declareBinding(binding);
    } catch (AmqpIOException ex) {
      Throwable cause = ex;
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

    }
  }

  @Test
  public void testSpringWithDefaultExchangeNonImplicitBinding() throws Exception {
    Exchange exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME);
    context.getBeanFactory().registerSingleton("foo", exchange);
    String queueName = "test.queue";
    final Queue queue = new Queue(queueName, false, false, false);
    context.getBeanFactory().registerSingleton("bar", queue);
    Binding binding = new Binding(queueName, DestinationType.QUEUE, exchange.getName(), "test.routingKey", null);
    context.getBeanFactory().registerSingleton("baz", binding);
    rabbitAdmin.afterPropertiesSet();

    try {
      rabbitAdmin.declareBinding(binding);
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

      Exchange x;
      if ("topic".equals(exchangeType)) {
        x = new TopicExchange(exchangeName, durable, autoDelete);
      }
      else if ("direct".equals(exchangeType)) {
        x = new DirectExchange(exchangeName, durable, autoDelete);
      }
      else if ("fanout".equals(exchangeType)) {
        x = new FanoutExchange(exchangeName, durable, autoDelete);
      }
      else if ("headers".equals(exchangeType)) {
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

      Exchange x;
      if ("topic".equals(this.exchangeType)) {
        x = new TopicExchange(this.exchangeName, this.durable, this.autoDelete);
      }
      else if ("direct".equals(this.exchangeType)) {
        x = new DirectExchange(this.exchangeName, this.durable, this.autoDelete);
      }
      else if ("fanout".equals(this.exchangeType)) {
        x = new FanoutExchange(this.exchangeName, this.durable, this.autoDelete);
      }
      else if ("headers".equals(this.exchangeType)) {
View Full Code Here

Examples of org.springframework.amqp.core.DirectExchange

    reader.loadBeanDefinitions(new ClassPathResource(getClass().getSimpleName() + "-context.xml", getClass()));
  }

  @Test
  public void testDirectExchange() throws Exception {
    DirectExchange exchange = beanFactory.getBean("direct", DirectExchange.class);
    assertNotNull(exchange);
    assertEquals("direct", exchange.getName());
    assertTrue(exchange.isDurable());
    assertFalse(exchange.isAutoDelete());
    assertFalse(exchange.shouldDeclare());
    assertEquals(2, exchange.getDeclaringAdmins().size());
    Binding binding = beanFactory.getBean("org.springframework.amqp.rabbit.config.BindingFactoryBean#0", Binding.class);
    assertFalse(binding.shouldDeclare());
    assertEquals(2, binding.getDeclaringAdmins().size());

    Map<String, Object> arguments = binding.getArguments();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.