Skip to content

Commit 5272d35

Browse files
committed
Document dispatching executor service
1 parent 6fab398 commit 5272d35

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/main/java/com/rabbitmq/client/amqp/ConnectionBuilder.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,17 @@ public interface ConnectionBuilder extends ConnectionSettings<ConnectionBuilder>
4040
/**
4141
* Set the executor service to use for incoming message delivery.
4242
*
43-
* <p>The executor service is shared between the connection consumers, unless a consumer sets its
44-
* own executor service with {@link ConsumerBuilder#dispatchingExecutorService(ExecutorService)}.
43+
* <p>The executor service is shared between the connection consumers.
4544
*
46-
* <p>By default, a new single-threaded executor is created.
45+
* <p>By default, an executor service with {@link Runtime#availableProcessors()} thread(s) is
46+
* created for the connection.
4747
*
4848
* <p>It is the developer's responsibility to shut down the executor when it is no longer needed.
4949
*
5050
* @param executorService executor service for incoming message delivery
5151
* @return this builder instance
52-
* @see ConsumerBuilder#dispatchingExecutorService(ExecutorService)
52+
* @see
53+
* com.rabbitmq.client.amqp.impl.AmqpEnvironmentBuilder#dispatchingExecutorService(ExecutorService)
5354
*/
5455
ConnectionBuilder dispatchingExecutorService(ExecutorService executorService);
5556

src/main/java/com/rabbitmq/client/amqp/impl/AmqpEnvironmentBuilder.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ public AmqpEnvironmentBuilder executorService(ExecutorService executorService) {
5151
return this;
5252
}
5353

54+
/**
55+
* Set the shared executor service to use for incoming message delivery in this environment
56+
* instance connections.
57+
*
58+
* <p>There is no shared executor service by default, each connection uses its own, see {@link
59+
* ConnectionBuilder#dispatchingExecutorService(ExecutorService)}.
60+
*
61+
* <p>It is the developer's responsibility to shut down the executor when it is no longer needed.
62+
*
63+
* @param executorService the executor service for incoming message delivery
64+
* @return this builder instance
65+
* @see ConnectionBuilder#dispatchingExecutorService(ExecutorService)
66+
*/
5467
public AmqpEnvironmentBuilder dispatchingExecutorService(ExecutorService executorService) {
5568
this.dispatchingExecutorService = executorService;
5669
return this;

0 commit comments

Comments
 (0)