Skip to content

Commit 452a383

Browse files
committed
Mention producers are thread-safe
1 parent 1a6bf16 commit 452a383

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/docs/asciidoc/api.adoc

+7
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,13 @@ include::{test-examples}/ProducerUsage.java[tag=producer-creation]
328328
Consider a `Producer` instance like a long-lived object, do not create one
329329
to send just one message.
330330

331+
332+
[NOTE]
333+
.Producer thread safety
334+
====
335+
Producer instances are thread-safe.
336+
====
337+
331338
Internally, the `Environment` will query the broker to find out about
332339
the topology of the stream and will create or re-use a connection to
333340
publish to the leader node of the stream.

src/main/java/com/rabbitmq/stream/Producer.java

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*
1919
* <p>Instances are created and configured with a {@link ProducerBuilder}.
2020
*
21+
* Implementations are expected to be thread-safe, RabbitMQ Streams' are.
22+
*
2123
* @see ProducerBuilder
2224
* @see Environment#producerBuilder()
2325
*/

0 commit comments

Comments
 (0)