Package org.springframework.amqp.core

Examples of org.springframework.amqp.core.Queue


     */
    @Bean
    public Queue replyQueue() {
      Map<String, Object> args = new HashMap<String, Object>();
      args.put("x-dead-letter-exchange", "reply.dlx");
      return new Queue("dlx.test.replyQ", false, false, true, args);
    }
View Full Code Here


    /**
     * @return an (auto-delete) queue.
     */
    @Bean
    public Queue dlq() {
      return new Queue("dlx.test.DLQ", false, false, true);
    }
View Full Code Here

  @Test
  public void testNoFailOnStartupWithMissingBroker() throws Exception {
    SingleConnectionFactory connectionFactory = new SingleConnectionFactory("foo");
    connectionFactory.setPort(434343);
    GenericApplicationContext applicationContext = new GenericApplicationContext();
    applicationContext.getBeanFactory().registerSingleton("foo", new Queue("queue"));
    RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
    rabbitAdmin.setApplicationContext(applicationContext);
    rabbitAdmin.setAutoStartup(true);
    rabbitAdmin.afterPropertiesSet();
    connectionFactory.destroy();
View Full Code Here

  @Test
  public void testFailOnFirstUseWithMissingBroker() throws Exception {
    SingleConnectionFactory connectionFactory = new SingleConnectionFactory("foo");
    connectionFactory.setPort(434343);
    GenericApplicationContext applicationContext = new GenericApplicationContext();
    applicationContext.getBeanFactory().registerSingleton("foo", new Queue("queue"));
    RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
    rabbitAdmin.setApplicationContext(applicationContext);
    rabbitAdmin.setAutoStartup(true);
    rabbitAdmin.afterPropertiesSet();
    exception.expect(IllegalArgumentException.class);
View Full Code Here

    SingleConnectionFactory connectionFactory = new SingleConnectionFactory();
    connectionFactory.setHost("localhost");
    RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
    String queueName = "test.properties." + System.currentTimeMillis();
    try {
      rabbitAdmin.declareQueue(new Queue(queueName));
      new RabbitTemplate(connectionFactory).convertAndSend(queueName, "foo");
      int n = 0;
      while (n++ < 100 && messageCount(rabbitAdmin, queueName) == 0) {
        Thread.sleep(100);
      }
View Full Code Here

        return null;
      }
    }).when(cf).addConnectionListener(any(ConnectionListener.class));
    RabbitAdmin admin = new RabbitAdmin(cf);
    GenericApplicationContext context = new GenericApplicationContext();
    Queue queue = new Queue("foo");
    context.getBeanFactory().registerSingleton("foo", queue);
    DirectExchange exchange = new DirectExchange("bar");
    context.getBeanFactory().registerSingleton("bar", exchange);
    Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);
    context.getBeanFactory().registerSingleton("baz", binding);
View Full Code Here

    ccf.setCacheMode(CacheMode.CONNECTION);
    ccf.afterPropertiesSet();

    RabbitAdmin admin = new RabbitAdmin(ccf);
    GenericApplicationContext context = new GenericApplicationContext();
    Queue queue = new Queue("foo");
    context.getBeanFactory().registerSingleton("foo", queue);
    context.refresh();
    admin.setApplicationContext(context);
    admin.afterPropertiesSet();
    ccf.createConnection().close();
View Full Code Here

        return null;
      }
    }).when(cf).addConnectionListener(any(ConnectionListener.class));
    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);
View Full Code Here

      }
    }).when(cf).addConnectionListener(any(ConnectionListener.class));
    RabbitAdmin admin = new RabbitAdmin(cf);
    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);
View Full Code Here

        return null;
      }
    }).when(cf).addConnectionListener(any(ConnectionListener.class));
    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);
View Full Code Here

TOP

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

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.