Examples of DirectExchange


Examples of org.springframework.amqp.core.DirectExchange

        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

Examples of org.springframework.amqp.core.DirectExchange

  }

  @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

Examples of org.springframework.amqp.core.DirectExchange

    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

Examples of org.springframework.amqp.core.DirectExchange

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

Examples of org.springframework.amqp.core.DirectExchange

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

Examples of org.springframework.amqp.core.DirectExchange

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

Examples of org.springframework.amqp.core.DirectExchange

    }).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

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

Examples of org.springframework.amqp.core.DirectExchange

    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

Examples of org.springframework.amqp.core.DirectExchange

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