momo-jun commented on code in PR #17235:
URL: https://github.com/apache/pulsar/pull/17235#discussion_r953576262
##########
site2/docs/client-libraries-java.md:
##########
@@ -596,9 +596,98 @@ Producer<byte[]> producer = client.newProducer()
```
-### Message routing
+### Publish to partitioned topics
-When using partitioned topics, you can specify the routing mode whenever you
publish messages using a producer. For more information on specifying a routing
mode using the Java client, see the [Partitioned Topics
cookbook](cookbooks-partitioned.md).
+By default, Pulsar topics are served by a single broker, which limits the
maximum throughput of a topic. *Partitioned topics* can span multiple brokers
and thus allow for higher throughput.
+
+You can publish to partitioned topics using Pulsar client libraries. When
publishing to partitioned topics, you must specify a routing mode. If you do
not specify any routing mode when you create a new producer, the round robin
routing mode is used.
+
+#### Routing mode
+
+You can specify the routing mode in the ProducerConfiguration object that you
use to configure your producer. The routing mode determines which
partition(internal topic) that each message should be published to.
+
+The following {@inject:
javadoc:MessageRoutingMode:/client/org/apache/pulsar/client/api/MessageRoutingMode}
options are available.
+
+Mode | Description
+:--------|:------------
+`RoundRobinPartition` | If no key is provided, the producer publishes messages
across all partitions in round-robin policy to achieve the maximum throughput.
Round-robin is not done per individual message, round-robin is set to the same
boundary of batching delay to ensure that batching is effective. If a key is
specified on the message, the partitioned producer hashes the key and assigns
message to a particular partition. This is the default mode.
+`SinglePartition` | If no key is provided, the producer picks a single
partition randomly and publishes all messages into that partition. If a key is
specified on the message, the partitioned producer hashes the key and assigns
message to a particular partition.
Review Comment:
```suggestion
`SinglePartition` | If no key is provided, the producer picks a single
partition randomly and publishes all messages into that partition. If a key is
specified on the message, the partitioned producer hashes the key and assigns
the message to a particular partition.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]