Example usage for org.springframework.amqp.core Binding getDestination

List of usage examples for org.springframework.amqp.core Binding getDestination

Introduction

In this page you can find the example usage for org.springframework.amqp.core Binding getDestination.

Prototype

public String getDestination() 

Source Link

Usage

From source file:org.springframework.amqp.rabbit.core.RabbitAdmin.java

@ManagedOperation
public void removeBinding(final Binding binding) {
    rabbitTemplate.execute(new ChannelCallback<Object>() {
        public Object doInRabbit(Channel channel) throws Exception {
            if (binding.isDestinationQueue()) {
                if (isRemovingImplicitQueueBinding(binding)) {
                    return null;
                }//from  ww  w  .  j a v  a2s. c  o  m

                channel.queueUnbind(binding.getDestination(), binding.getExchange(), binding.getRoutingKey(),
                        binding.getArguments());
            } else {
                channel.exchangeUnbind(binding.getDestination(), binding.getExchange(), binding.getRoutingKey(),
                        binding.getArguments());
            }
            return null;
        }
    });
}

From source file:org.springframework.amqp.rabbit.core.RabbitAdmin.java

private void declareBindings(final Channel channel, final Binding... bindings) throws IOException {
    for (Binding binding : bindings) {
        if (logger.isDebugEnabled()) {
            logger.debug("Binding destination [" + binding.getDestination() + " ("
                    + binding.getDestinationType() + ")] to exchange [" + binding.getExchange()
                    + "] with routing key [" + binding.getRoutingKey() + "]");
        }//  ww  w  . j av  a 2s.  co  m

        if (binding.isDestinationQueue()) {
            if (!isDeclaringImplicitQueueBinding(binding)) {
                channel.queueBind(binding.getDestination(), binding.getExchange(), binding.getRoutingKey(),
                        binding.getArguments());
            }
        } else {
            channel.exchangeBind(binding.getDestination(), binding.getExchange(), binding.getRoutingKey(),
                    binding.getArguments());
        }
    }
}

From source file:org.springframework.amqp.rabbit.core.RabbitAdmin.java

private boolean isImplicitQueueBinding(Binding binding) {
    return isDefaultExchange(binding.getExchange()) && binding.getDestination().equals(binding.getRoutingKey());
}