Package org.springframework.amqp.core

Examples of org.springframework.amqp.core.Exchange


      boolean durable = params.containsKey(DURABLE) ? (Boolean) params.get(DURABLE) : false;
      boolean autoDelete = params.containsKey(AUTO_DELETE) ? (Boolean) params.get(AUTO_DELETE) : false;
      Map arguments = params.containsKey(ARGUMENTS) ? (Map) params.get(ARGUMENTS) : null;
      currentRoutingKey = null;

      Exchange exchange = null;
      String name = null;
      if (params.containsKey(NAME)) {
        name = params.get(NAME).toString();
      }
      if (params.containsKey(TYPE)) {
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

   * Maybe declare the exchange.
   */
  protected void maybeDeclareExchange() {
    RabbitAdmin admin = new RabbitAdmin(connectionFactory);
    if (declareExchange) {
      Exchange x;
      if ("topic".equals(exchangeType)) {
        x = new TopicExchange(exchangeName, durable, autoDelete);
      }
      else if ("direct".equals(exchangeType)) {
        x = new DirectExchange(exchangeName, durable, autoDelete);
View Full Code Here

   * Maybe declare the exchange.
   */
  protected void maybeDeclareExchange() {
    RabbitAdmin admin = new RabbitAdmin(this.connectionFactory);
    if (this.declareExchange) {
      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);
View Full Code Here

TOP

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

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.