diff --git a/docs/client-libraries-producers.md b/docs/client-libraries-producers.md index 8a4aaa691813..63fe47a1dfdc 100644 --- a/docs/client-libraries-producers.md +++ b/docs/client-libraries-producers.md @@ -784,4 +784,51 @@ This example shows how to set the `EnforceUnencrypted` encryption policy. -```` \ No newline at end of file +```` + +## Configure access mode + +[Access mode](concepts-clients.md#access-mode) allows applications to require exclusive producer access on a topic to achieve a "single-writer" situation. + +This example shows how to set producer access mode. + +````mdx-code-block + + + +::: note + +This feature is supported in Java client 2.8.0 or later versions. + +::: + + ```java + Producer producer = client.newProducer() + .topic(topic) + .accessMode(ProducerAccessMode.Exclusive) + .create(); + ``` + + + + + +::: note + +This feature is supported in C++ client 3.1.0 or later versions. + +::: + + ```cpp + Producer producer; + ProducerConfiguration producerConfiguration; + producerConfiguration.setAccessMode(ProducerConfiguration::Exclusive); + client.createProducer(topicName, producerConfiguration, producer); + ``` + + + + +````