Skip to content

Commit 9137a36

Browse files
committed
CachingCF Threading Doc Polishing
1 parent cc0323a commit 9137a36

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/reference/asciidoc/amqp.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,10 +3554,12 @@ When a `TaskExecutor` is specifically provided through the `taskExecutor` proper
35543554
It is recommended that you use a similar technique to name the threads created by a custom `TaskExecutor` bean definition, to aid with thread identification in log messages.
35553555

35563556
The `Executor` configured in the `CachingConnectionFactory` is passed into the `RabbitMQ Client` when creating the connection, and its threads are used to deliver new messages to the listener container.
3557-
If this is not configured, the client uses an internal thread pool executor with a pool size of five.
3557+
If this is not configured, the client uses an internal thread pool executor with (at the time of writing) a pool size of `Runtime.getRuntime().availableProcessors() * 2` for each connection.
35583558

3559-
IMPORTANT: With the `DirectMessageListenerContainer`, you need to ensure that the connection factory is configured with a task executor that had sufficient threads to support your desired concurrency across all listener containers that use that factory.
3560-
The default pool size is only five.
3559+
If you have a large number of factories or are using `CacheMode.CONNECTION`, you may wish to consider using a shared `ThreadPoolTaskExecutor` with enough threads to satisfy your workload.
3560+
3561+
IMPORTANT: With the `DirectMessageListenerContainer`, you need to ensure that the connection factory is configured with a task executor that has sufficient threads to support your desired concurrency across all listener containers that use that factory.
3562+
The default pool size (at the time of writing) is `Runtime.getRuntime().availableProcessors() * 2`.
35613563

35623564
The `RabbitMQ client` uses a `ThreadFactory` to create threads for low-level I/O (socket) operations.
35633565
To modify this factory, you need to configure the underlying RabbitMQ `ConnectionFactory`, as discussed in <<connection-factory>>.

0 commit comments

Comments
 (0)