Package org.springframework.amqp.core

Examples of org.springframework.amqp.core.DirectExchange


    RabbitAdmin admin = new RabbitAdmin(cf);
    GenericApplicationContext context = new GenericApplicationContext();
    Queue queue = new Queue("foo");
    queue.setAdminsThatShouldDeclare(admin);
    context.getBeanFactory().registerSingleton("foo", queue);
    DirectExchange exchange = new DirectExchange("bar");
    exchange.setAdminsThatShouldDeclare(admin);
    context.getBeanFactory().registerSingleton("bar", exchange);
    Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);
    binding.setAdminsThatShouldDeclare(admin);
    context.getBeanFactory().registerSingleton("baz", binding);
    context.refresh();
View Full Code Here


    RabbitAdmin other = new RabbitAdmin(cf);
    GenericApplicationContext context = new GenericApplicationContext();
    Queue queue = new Queue("foo");
    queue.setAdminsThatShouldDeclare(other);
    context.getBeanFactory().registerSingleton("foo", queue);
    DirectExchange exchange = new DirectExchange("bar");
    exchange.setAdminsThatShouldDeclare(other);
    context.getBeanFactory().registerSingleton("bar", exchange);
    Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);
    binding.setAdminsThatShouldDeclare(other);
    context.getBeanFactory().registerSingleton("baz", binding);
    context.refresh();
View Full Code Here

    RabbitAdmin admin = new RabbitAdmin(cf);
    GenericApplicationContext context = new GenericApplicationContext();
    Queue queue = new Queue("foo");
    queue.setShouldDeclare(false);
    context.getBeanFactory().registerSingleton("foo", queue);
    DirectExchange exchange = new DirectExchange("bar");
    exchange.setShouldDeclare(false);
    context.getBeanFactory().registerSingleton("bar", exchange);
    Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);
    binding.setShouldDeclare(false);
    context.getBeanFactory().registerSingleton("baz", binding);
    context.refresh();
View Full Code Here

      return queue;
    }

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

    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

    // 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

    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

    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

    // 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

    }
  }

  @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

TOP

Related Classes of org.springframework.amqp.core.DirectExchange

Copyright © 2018 www.massapicom. 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.