JIRA: https://jira.spring.io/browse/AMQP-512 Ensure test queues are removed after tests. Some tests relied on the queues existing already. Also make sure connections are closed when tests complete. Use Docker on Travis
Spring IO Platform 2.0 will remove the managed versions .properties file as support for it has been removed in Spring Boot 1.3. This commit moves the build onto a new version of the Spring IO Plugin that uses the Maven bom rather than the properties file.
JIRA:https://jira.spring.io/browse/AMQP-506 `RabbitTemplate` provides a method `getUnconfirmed` to get aged non-confirmed correlation data. This was not thread-safe. While the `pendingConfirms` objects in `RabbitTemplate` and `PublisherCallbackChannelImpl` are concurrent hash maps, they are maps of maps with the inner maps being `Collections.synchronizedSortedMap`. While iterating over these maps, they must be synchronized. Add a test case to reproduce the exception and verify the problem is resovled.
Previously the setUri() method on rabbitmq.ConnectionFactory was not exposed to the CachingConnectionFactory nor the SingleConnectionFactory. This change adds this method to the AbstractConnectionFactory, which is then inherited by the two implementation classes. A constructor taking the URI is added to CachingConnectionFactory and also to the SingleConnectionFactory to short-circuit the construction even further. AMQP-505: Polishing
JIRA: https://jira.spring.io/browse/AMQP-503 Now that the `QueueingConsumer` is no longer deprecated, add `receiveTimeout` to the `RabbitTemplate` to allow for blocking `receive` operations. AMQP-503: Polishing; PR Comments
JIRA: https://jira.spring.io/browse/AMQP-502 Queues are bound to fanout exchanges with no routing key. The `RabbitListenerAnnotationBeanPostProcessor` incorrectly set the key to `null` instead of `""`. Add a test for a fanout exchange.
JIRA: https://jira.spring.io/browse/AMQP-498 In earlier versions, the while loop to drain the queue took an early exit when the channel was transacted. (This was actually incorrect since message delivery is not transactional, only acks). AMQP-388 introduced a new OR condition on the loop: `consumer.hasDelivery()`. This effectively made the `continuable` boolean in the OR condition irrelevant. This boolean was true if messages were received and the channel was not transactional. Another side effect was the `continuable` boolean was incorrectly used to adjust the consumers if the workload demanded. Instead, that decision should have depended just on whether messages were received; whether the channel is transacted is irrelevent. Remove the `continuable` boolean; fix the while loop and use a new boolean `receivedOk` which indicates whether messages were received and so whether we should consider increasing the consumers. Add a test to verify consumers are adjusted for transactional channels.
JIRA: https://jira.spring.io/browse/AMQP-496 Long lived message listener performs `channel.basicAck` (`channel.txCommit()`) too late, after stopping the container and connectionFactory. Since the closed `applicationContext` is in stale state already, mark `CachingConnectionFactory` as `stopped` after receiving `ContextClosedEvent` and don't allow a new `createConnection()`.
JIRA: https://jira.spring.io/browse/AMQP-427 To have more control over `recoveryInterval` add `BackOff` injection support for the `SimpleMessageListenerContainer`. When the `backOffExecution` reaches `BackOffExecution.STOP`, stop the container for further recovery to prevent infinite log records. PR comments and Docs
JIRA: https://jira.spring.io/browse/AMQP-481 Previously the `@Lazy` components haven't been registered with `MessageListenerContainer`, because `RabbitListenerEndpointRegistrar` has done that from its `afterPropertiesSet()`. Add logic to `registerListenerContainer` on demand from the `RabbitListenerEndpointRegistrar#registerEndpoint` **Cherry-pick to 1.4.x**
JIRA: https://jira.spring.io/browse/AMQP-444 Enable class-level `@RabbitListener` annotations, allowing for selection of indidividual `@RabbitHandler` methods based on `Message<?>` payload type. Method selection must be unambiguous. Fix JDK 8 Dependency Use `MethodParameter` instead of JDK 8 `method.getParameterAnnotations()`. Introduce @RabbitHandler Polishing - PR Comments * Make `com.rabbitmq:http-client` dependency as `optional`
JIRA: https://jira.spring.io/browse/AMQP-416 Use `<listener/>` id attribute alone. * Fix a couple typos in `whats-new.adoc` * Change the wrong mentioning for `<rabbit:message-listener-container/>` to the correct `<rabbit:listener-container/>`
JIRA: https://jira.spring.io/browse/AMQP-443 Provide a mechanism to auto-declare/bind the queues for a `@RabbitListener` annotation, if a `RabbitAdmin` is defined in the application context. AMQP-433: Docs and Polish Support anonymous queues; add docs. AMQP-443: Polishing and What's New