You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/13 18:06:25 UTC

[GitHub] [pulsar-client-reactive] cbornet commented on a diff in pull request #112: Add sendManyCorrelated to ReactiveMessageSender

cbornet commented on code in PR #112:
URL: https://github.com/apache/pulsar-client-reactive/pull/112#discussion_r1047540636


##########
pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/ReactiveMessageSender.java:
##########
@@ -40,11 +41,30 @@
 
 	/**
 	 * Send multiple messages and get the associated message ids in the same order as the
-	 * messages sent.
+	 * messages sent. A send error will terminate the returned Flux with an error that is
+	 * wrapped in a {@link CorrelatedMessageSendingException} where the
+	 * {@link CorrelatedMessageSendingException#getCorrelationKey(Class)} method will
+	 * return the MessageSpec sent as input.
 	 * @param messageSpecs the specs of the messages to send
 	 * @return a publisher that will emit a message id per message successfully sent in
 	 * the order that they have been sent
 	 */
 	Flux<MessageId> sendMany(Publisher<MessageSpec<T>> messageSpecs);
 
+	/**
+	 * Send multiple messages and correlate the resulted message ids to a provided
+	 * correlation key. The correlation key can be any type of object. A send error will
+	 * terminate the returned Flux with an error that is wrapped in a
+	 * {@link CorrelatedMessageSendingException} where the
+	 * {@link CorrelatedMessageSendingException#getCorrelationKey(Class)} method will
+	 * return the correlation key sent as input.
+	 * @param tuplesOfCorrelationKeyAndMessageSpec a publisher where the element is a
+	 * tuple of the correlation key and the specs of the message to send
+	 * @param <K> type of correlation key
+	 * @return a publisher that will emit a tuple of the provided correlation key and the
+	 * message id for each message successfully sent
+	 */
+	<K> Flux<Tuple2<K, MessageId>> sendManyCorrelated(

Review Comment:
   Do we need to call it `sendManyCorrelated ` or could we call it `sendMany` ?



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org