lhotari commented on code in PR #112:
URL:
https://github.com/apache/pulsar-client-reactive/pull/112#discussion_r1086430674
##########
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:
I think that having the concept of correlation as part of the method name
makes it easier to understand the purpose.
--
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]