Source:
private void declareExchangeAndBinding(QueueBinding binding, String queueName, org.springframework.amqp.rabbit.annotation.Exchange bindingExchange) { String exchangeName = resolveExpressionAsString(bindingExchange.value(), "@Exchange.exchange"); String exchangeType = resolveExpressionAsString(bindingExchange.type(), "@Exchange.type"); String routingKey = resolveExpressionAsString(binding.key(), "@QueueBinding.key"); Exchange exchange; Binding actualBinding; if (exchangeType.equals(ExchangeTypes.DIRECT)) { exchange = directExchange(bindingExchange, exchangeName); actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey, resolveArguments(binding.arguments())); } else if (exchangeType.equals(ExchangeTypes.FANOUT)) { exchange = fanoutExchange(bindingExchange, exchangeName); actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, "", resolveArguments(binding.arguments())); } else if (exchangeType.equals(ExchangeTypes.TOPIC)) { exchange = topicExchange(bindingExchange, exchangeName); actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey, resolveArguments(binding.arguments())); } else if (exchangeType.equals(ExchangeTypes.HEADERS)) { exchange = headersExchange(bindingExchange, exchangeName); actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey, resolveArguments(binding.arguments())); } else { throw new BeanInitializationException("Unexpected exchange type: " + exchangeType); } ((ConfigurableBeanFactory) this.beanFactory).registerSingleton(exchangeName + ++this.increment, exchange); ((ConfigurableBeanFactory) this.beanFactory).registerSingleton(exchangeName + ++this.increment, actualBinding); }

Target:
private void declareExchangeAndBinding(QueueBinding binding, String queueName, org.springframework.amqp.rabbit.annotation.Exchange bindingExchange) { String exchangeName = resolveExpressionAsString(bindingExchange.value(), "@Exchange.exchange"); String exchangeType = resolveExpressionAsString(bindingExchange.type(), "@Exchange.type"); String routingKey = resolveExpressionAsString(binding.key(), "@QueueBinding.key"); Exchange exchange; Binding actualBinding; if (exchangeType.equals(ExchangeTypes.DIRECT)) { exchange = directExchange(bindingExchange, exchangeName); actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey, resolveArguments(binding.arguments())); } else if (exchangeType.equals(ExchangeTypes.FANOUT)) { exchange = fanoutExchange(bindingExchange, exchangeName); actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, "", resolveArguments(binding.arguments())); } else if (exchangeType.equals(ExchangeTypes.TOPIC)) { exchange = topicExchange(bindingExchange, exchangeName); actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey, resolveArguments(binding.arguments())); } else if (exchangeType.equals(ExchangeTypes.HEADERS)) { exchange = headersExchange(bindingExchange, exchangeName); actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey, resolveArguments(binding.arguments())); } else { throw new BeanInitializationException("Unexpected exchange type: " + exchangeType); } ((ConfigurableBeanFactory) this.beanFactory).registerSingleton(exchangeName + ++this.increment, exchange); ((ConfigurableBeanFactory) this.beanFactory).registerSingleton( exchangeName + "." + queueName + ++this.increment, actualBinding); }