{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-projects/spring-amqp/issues/408","repository_url":"https://api.github.com/repos/spring-projects/spring-amqp","labels_url":"https://api.github.com/repos/spring-projects/spring-amqp/issues/408/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-amqp/issues/408/comments","events_url":"https://api.github.com/repos/spring-projects/spring-amqp/issues/408/events","html_url":"https://github.com/spring-projects/spring-amqp/issues/408","id":150991072,"number":408,"title":"Unexpected exchange type: headers","user":{"login":"SergiusSidorov","id":6388340,"avatar_url":"https://avatars.githubusercontent.com/u/6388340?v=3","gravatar_id":"","url":"https://api.github.com/users/SergiusSidorov","html_url":"https://github.com/SergiusSidorov","followers_url":"https://api.github.com/users/SergiusSidorov/followers","following_url":"https://api.github.com/users/SergiusSidorov/following{/other_user}","gists_url":"https://api.github.com/users/SergiusSidorov/gists{/gist_id}","starred_url":"https://api.github.com/users/SergiusSidorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergiusSidorov/subscriptions","organizations_url":"https://api.github.com/users/SergiusSidorov/orgs","repos_url":"https://api.github.com/users/SergiusSidorov/repos","events_url":"https://api.github.com/users/SergiusSidorov/events{/privacy}","received_events_url":"https://api.github.com/users/SergiusSidorov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-25T21:51:58Z","updated_at":"2016-04-27T20:21:57Z","closed_at":"2016-04-27T20:21:57Z","body":"Hi!\r\n\r\nWhen I try to bind queue to headers exchange through annotation `@RabbitListener -> bindings -> @QueueBinding`, I receive exception: `Unexpected exchange type: headers`\r\n\r\nI inspect class `RabbitListenerAnnotationBeanPostProcessor` and found next code:\r\n\r\n```java\r\nif (exchangeType.equals(ExchangeTypes.DIRECT)) {\r\n    exchange = new DirectExchange(exchangeName,\r\n            resolveExpressionAsBoolean(bindingExchange.durable()),\r\n            resolveExpressionAsBoolean(bindingExchange.autoDelete()));\r\n    actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, resolvedKey, null);\r\n}\r\nelse if (exchangeType.equals(ExchangeTypes.FANOUT)) {\r\n    exchange = new FanoutExchange(exchangeName,\r\n            resolveExpressionAsBoolean(bindingExchange.durable()),\r\n            resolveExpressionAsBoolean(bindingExchange.autoDelete()));\r\n    actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, \"\", null);\r\n}\r\nelse if (exchangeType.equals(ExchangeTypes.TOPIC)) {\r\n    exchange = new TopicExchange(exchangeName,\r\n            resolveExpressionAsBoolean(bindingExchange.durable()),\r\n            resolveExpressionAsBoolean(bindingExchange.autoDelete()));\r\n    actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, resolvedKey, null);\r\n}\r\nelse {\r\n    throw new BeanInitializationException(\"Unexpected exchange type: \" + exchangeType);\r\n}\r\n```\r\n\r\ni.e. binding to headers exchange not supported in annotation `@RabbitListener`.\r\nWhy?"}}