Polish "Support direct AMQP container"

Closes gh-9055
This commit is contained in:
Stephane Nicoll
2017-05-04 18:00:06 +02:00
parent 6eddf1b372
commit 2894e57146
8 changed files with 265 additions and 210 deletions

View File

@@ -975,13 +975,13 @@ content into your application; rather pick only the properties that you need.
spring.rabbitmq.connection-timeout= # Connection timeout, in milliseconds; zero for infinite.
spring.rabbitmq.dynamic=true # Create an AmqpAdmin bean.
spring.rabbitmq.host=localhost # RabbitMQ host.
spring.rabbitmq.listener.direct.consumers-per-queue= # Number of consumers per queue.
spring.rabbitmq.listener.simple.acknowledge-mode= # Acknowledge mode of container.
spring.rabbitmq.listener.simple.auto-startup=true # Start the container automatically on startup.
spring.rabbitmq.listener.simple.concurrency= # Minimum number of listener invoker threads for a `simple` container.
spring.rabbitmq.listener.consumers-per-queue= # The number of Consumers per queue for a `direct` container.
spring.rabbitmq.listener.simple.default-requeue-rejected= # Whether or not to requeue delivery failures; default `true`.
spring.rabbitmq.listener.simple.concurrency= # Minimum number of listener invoker threads.
spring.rabbitmq.listener.simple.default-requeue-rejected= # Whether or not to requeue delivery failures.
spring.rabbitmq.listener.simple.idle-event-interval= # How often idle container events should be published in milliseconds.
spring.rabbitmq.listener.simple.max-concurrency= # Maximum number of listener invoker for a `simple` container.
spring.rabbitmq.listener.simple.max-concurrency= # Maximum number of listener invoker.
spring.rabbitmq.listener.simple.prefetch= # Number of messages to be handled in a single request. It should be greater than or equal to the transaction size (if used).
spring.rabbitmq.listener.simple.retry.enabled=false # Whether or not publishing retries are enabled.
spring.rabbitmq.listener.simple.retry.initial-interval=1000 # Interval between the first and second attempt to deliver a message.
@@ -989,8 +989,8 @@ content into your application; rather pick only the properties that you need.
spring.rabbitmq.listener.simple.retry.max-interval=10000 # Maximum interval between attempts.
spring.rabbitmq.listener.simple.retry.multiplier=1.0 # A multiplier to apply to the previous delivery retry interval.
spring.rabbitmq.listener.simple.retry.stateless=true # Whether or not retry is stateless or stateful.
spring.rabbitmq.listener.simple.transaction-size= Number of messages to be processed in a transaction; number of messages between acks. For best results it should be less than or equal to the prefetch count - applies only to `simple` containers.
spring.rabbitmq.listener.type= # The listener container type `simple` or `direct`; default `simple`.
spring.rabbitmq.listener.simple.transaction-size= # Number of messages to be processed in a transaction; number of messages between acks. For best results it should be less than or equal to the prefetch count.
spring.rabbitmq.listener.type=simple # Listener container type.
spring.rabbitmq.password= # Login to authenticate against the broker.
spring.rabbitmq.port=5672 # RabbitMQ port.
spring.rabbitmq.publisher-confirms=false # Enable publisher confirms.

View File

@@ -4653,9 +4653,10 @@ the broker connection is lost. Retries are disabled by default.
==== Receiving a message
When the Rabbit infrastructure is present, any bean can be annotated with
`@RabbitListener` to create a listener endpoint. If no `RabbitListenerContainerFactory`
has been defined, a default one is configured automatically. If a `MessageConverter` or
`MessageRecoverer` beans are defined, they are associated automatically to the default
factory.
has been defined, a default `SimpleRabbitListenerContainerFactory` is configured
automatically and you can switch to a direct container using the
`spring.rabbitmq.listener.type` property. If a `MessageConverter` or `MessageRecoverer`
beans are defined, they are associated automatically to the default factory.
The following component creates a listener endpoint on the `someQueue` queue:
@@ -4677,9 +4678,13 @@ for more details.
If you need to create more `RabbitListenerContainerFactory` instances or if you want to
override the default, Spring Boot provides a
`SimpleRabbitListenerContainerFactoryConfigurer` that you can use to initialize a
`SimpleRabbitListenerContainerFactory` with the same settings as the one that is
auto-configured.
`SimpleRabbitListenerContainerFactoryConfigurer` and
`DirectRabbitListenerContainerFactoryConfigurer` that you can use to initialize a
`SimpleRabbitListenerContainerFactory` and `DirectRabbitListenerContainerFactory` with the
same settings as the one used by the auto-configuration.
TIP: It doesn't matter which container type you've chosen, those two beans are exposed by
the auto-configuration.
For instance, the following exposes another factory that uses a specific
`MessageConverter`: