Package org.springframework.amqp.core

Examples of org.springframework.amqp.core.DirectExchange


    return new Queue(QueueNames.RESULT_QUEUE_NAME);
  }
 
  @Bean
  public DirectExchange piExchange() {
    return new DirectExchange("piExchange");
  }
View Full Code Here


    return new Queue(QueueNames.RESULT_QUEUE_NAME);
  }
 
  @Bean
  public DirectExchange piExchange() {
    return new DirectExchange("piExchange");
  }
View Full Code Here

        name = params.get(NAME).toString();
      }
      if (params.containsKey(TYPE)) {
        String type = params.containsKey(TYPE) ? params.get(TYPE).toString() : DIRECT;
        if (DIRECT.equals(type)) {
          exchange = new DirectExchange(name, durable, autoDelete, arguments);
        } else if (TOPIC.equals(type)) {
          exchange = new TopicExchange(name, durable, autoDelete, arguments);
        } else if (FANOUT.equals(type)) {
          exchange = new FanoutExchange(name, durable, autoDelete, arguments);
        } else if (HEADERS.equals(type)) {
          exchange = new HeadersExchange(name, durable, autoDelete, arguments);
        } else {
          exchange = new CustomExchange(name, type, durable, autoDelete, arguments);
        }
        currentExchange = exchange;

      } else {
        currentExchange = new DirectExchange(name);
      }
      try {
        rabbitAdmin.declareExchange(currentExchange);
      } catch (Exception e) {
        log.error(e.getMessage(), e);
View Full Code Here

        return builder.toString();       
    }
   
    org.springframework.amqp.core.Exchange createAMQPExchange() {
        if("direct".equals(this.exchangeType)) {
            return new DirectExchange(this.exchangeName, this.durable, this.autodelete);
        } else if("fanout".equals(this.exchangeType)) {
            return new FanoutExchange(this.exchangeName, this.durable, this.autodelete);
        } else if("headers".equals(this.exchangeType)) {
            return new HeadersExchange(this.exchangeName, this.durable, this.autodelete);
        } else if("topic".equals(this.exchangeType)) {
            return new TopicExchange(this.exchangeName, this.durable, this.autodelete);
        //We have a routing key but no explicit exchange type, assume topic exchange
        } else if(this.routingKey != null) {
            return new TopicExchange(this.exchangeName, this.durable, this.autodelete);
        } else {
            return new DirectExchange(this.exchangeName, this.durable, this.autodelete);
        }
    }
View Full Code Here

  }

  @Bean
  public Binding binding() {
    amqpAdmin().declareQueue(new Queue(queueName));
    Binding binding = new Binding(new Queue(queueName), new DirectExchange(exchange), routingKey);
    amqpAdmin().declareBinding(binding);
    return binding;
  }
View Full Code Here

    Map<String, Object> args = new HashMap<String, Object>();
    args.put("x-dead-letter-exchange", "test.DLE");
    Queue queue = new Queue("", false, false, true, args);
    String testQueueName = admin.declareQueue(queue);
    // Create a DeadLetterExchange and bind a queue to it with the original routing key
    DirectExchange dle = new DirectExchange("test.DLE", false, true);
    admin.declareExchange(dle);
    Queue dlq = new AnonymousQueue();
    admin.declareQueue(dlq);
    admin.declareBinding(BindingBuilder.bind(dlq).to(dle).with(testQueueName));
View Full Code Here

    /**
     * @return a non-durable auto-delete exchange.
     */
    @Bean
    public DirectExchange ex() {
      return new DirectExchange(UUID.randomUUID().toString(), false, true);
    }
View Full Code Here

    /**
     * @return a non-durable auto-delete exchange.
     */
    @Bean
    public DirectExchange ex() {
      return new DirectExchange("dlx.test.requestEx", false, true);
    }
View Full Code Here

    /**
     * @return a non-durable auto-delete exchange.
     */
    @Bean
    public DirectExchange dlx() {
      return new DirectExchange("reply.dlx", false, true);
    }
View Full Code Here

    }).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);
    context.refresh();
    admin.setApplicationContext(context);
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.