Spring AMQP

Authors

Mark Pollack , Mark Fisher , Oleg Zhurakousky , Dave Syer , Gary Russell , Gunnar Hillert , Artem Bilan , Stéphane Nicoll

1.7.3.RELEASE

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Table of Contents

1. Preface
2. Introduction
2.1. Quick Tour for the impatient
2.1.1. Introduction
Compatibility
Very, Very Quick
With XML Configuration
With Java Configuration
2.2. What’s New
2.2.1. Changes in 1.7 Since 1.6
AMQP Client library
Log4j2 upgrade
Logback Appender
Spring Retry upgrade
FasterXML Jackson upgrade
JUnit @Rules
Container Conditional Rollback
Connection Naming Strategy
Listener Container Changes
2.2.2. Earlier Releases
3. Reference
3.1. Using Spring AMQP
3.1.1. AMQP Abstractions
Introduction
Message
Exchange
Queue
Binding
3.1.2. Connection and Resource Management
Introduction
Configuring the Underlying Client Connection Factory
RabbitConnectionFactoryBean and Configuring SSL
Routing Connection Factory
Queue Affinity and the LocalizedQueueConnectionFactory
Publisher Confirms and Returns
Logging Channel Close Events
Runtime Cache Properties
RabbitMQ Automatic Connection/Topology recovery
3.1.3. Adding Custom Client Connection Properties
3.1.4. AmqpTemplate
Introduction
Adding Retry Capabilities
Publisher Confirms and Returns
Messaging integration
Validated User Id
3.1.5. Sending messages
Introduction
Message Builder API
Publisher Returns
Batching
3.1.6. Receiving messages
Introduction
Polling Consumer
Asynchronous Consumer
Batched Messages
Consumer Failure Events
Consumer Tags
Annotation-driven Listener Endpoints
Threading and Asynchronous Consumers
Detecting Idle Asynchronous Consumers
3.1.7. Message Converters
Introduction
SimpleMessageConverter
SerializerMessageConverter
Jackson2JsonMessageConverter
MarshallingMessageConverter
ContentTypeDelegatingMessageConverter
Java Deserialization
Message Properties Converters
3.1.8. Modifying Messages - Compression and More
3.1.9. Request/Reply Messaging
Introduction
Reply Timeout
RabbitMQ Direct reply-to
Message Correlation With A Reply Queue
Reply Listener Container
AsyncRabbitTemplate
Spring Remoting with AMQP
3.1.10. Configuring the broker
Introduction
Builder API for Queues and Exchanges
Declaring Collections of Exchanges, Queues, Bindings
Conditional Declaration
AnonymousQueue
3.1.11. Delayed Message Exchange
3.1.12. RabbitMQ REST API
3.1.13. Exception Handling
3.1.14. Transactions
Introduction
Conditional Rollback
A note on Rollback of Received Messages
Using the RabbitTransactionManager
3.1.15. Message Listener Container Configuration
3.1.16. Listener Concurrency
3.1.17. Exclusive Consumer
3.1.18. Listener Container Queues
3.1.19. Resilience: Recovering from Errors and Broker Failures
Introduction
Automatic Declaration of Exchanges, Queues and Bindings
Failures in Synchronous Operations and Options for Retry
Message Listeners and the Asynchronous Case
Exception Classification for Retry
3.1.20. Debugging
3.2. Logging Subsystem AMQP Appenders
3.2.1. Common properties
3.2.2. Log4j Appender
3.2.3. Log4j2 Appender
3.2.4. Logback Appender
3.2.5. Customizing the Messages
3.2.6. Customizing the Client Properties
Simple String Properties
Advanced Technique for Log4j and Logback
3.3. Sample Applications
3.3.1. Introduction
3.3.2. Hello World
Introduction
Synchronous Example
Asynchronous Example
3.3.3. Stock Trading
3.4. Testing Support
3.4.1. Introduction
3.4.2. Mockito Answer<?> Implementations
3.4.3. @RabbitListenerTest and RabbitListenerTestHarness
3.4.4. JUnit @Rules
BrokerRunning
LongRunningIntegrationTest
4. Spring Integration - Reference
4.1. Spring Integration AMQP Support
4.1.1. Introduction
4.1.2. Inbound Channel Adapter
4.1.3. Outbound Channel Adapter
4.1.4. Inbound Gateway
4.1.5. Outbound Gateway
5. Other Resources
5.1. Further Reading
A. Change History
A.1. Current Release
A.2. Previous Releases
A.2.1. Changes in 1.6 Since 1.5
Testing Support
Builder
Namespace Changes
Listener Container Changes
AutoDeclare and RabbitAdmins
AmqpTemplate: receive with timeout
AsyncRabbitTemplate
RabbitTemplate Changes
Message Properties
RabbitAdmin Changes
@RabbitListener Changes
Delayed Message Exchange
Exchange internal flag
CachingConnectionFactory Changes
RabbitConnectionFactoryBean
Java Deserialization
JSON MessageConverter
Logging Appenders
RabbitTemplate Changes
A.2.2. Changes in 1.5 Since 1.4
spring-erlang is No Longer Supported
CachingConnectionFactory Changes
Properties to Control Container Queue Declaration Behavior
Class Package Change
DefaultMessagePropertiesConverter
@RabbitListener Improvements
Automatic Exchange, Queue, Binding Declaration
RabbitTemplate Changes
The RabbitManagementTemplate
Listener Container Bean Names (XML)
Class-Level @RabbitListener
SimpleMessageListenerContainer: BackOff support
Channel Close Logging
Application Events
Consumer Tag Configuration
MessageListenerAdapter
LocalizedQueueConnectionFactory
Anonymous Queue Naming
A.2.3. Changes in 1.4 Since 1.3
@RabbitListener Annotation
RabbitMessagingTemplate
Listener Container Missing Queues Fatal Attribute
RabbitTemplate ConfirmCallback Interface
RabbitConnectionFactoryBean
CachingConnectionFactory
Log Appender
Listener Queues
RabbitTemplate: mandatory and connectionFactorySelector Expressions
Listeners and the Routing Connection Factory
RabbitTemplate: RecoveryCallback option
MessageConversionException
RabbitMQ 3.4 Compatibility
ContentTypeDelegatingMessageConverter
A.2.4. Changes in 1.3 Since 1.2
Listener Concurrency
Listener Queues
Consumer Priority
Exclusive Consumer
Rabbit Admin
Direct Exchange Binding
AMQP Template
Caching Connection Factory
Binding Arguments
Routing Connection Factory
MessageBuilder and MessagePropertiesBuilder
RetryInterceptorBuilder
RepublishMessageRecoverer
Default Error Handler (Since 1.3.2)
Listener Container 'missingQueuesFatal` Property (Since 1.3.5)
A.2.5. Changes to 1.2 Since 1.1
RabbitMQ Version
Rabbit Admin
Rabbit Template
JSON Message Converters
Automatic Declaration of Queues, etc
AMQP Remoting
Requested Heart Beats
A.2.6. Changes to 1.1 Since 1.0
General
AMQP Log4j Appender