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/10/21 08:40:40 UTC

[GitHub] [pulsar-client-reactive] lhotari commented on a diff in pull request #12: Change ReactiveMessageSender API to use r.s.Publisher

lhotari commented on code in PR #12:
URL: https://github.com/apache/pulsar-client-reactive/pull/12#discussion_r1001524358


##########
pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/ReactiveMessageSender.java:
##########
@@ -17,13 +17,24 @@
 package org.apache.pulsar.reactive.client.api;
 
 import org.apache.pulsar.client.api.MessageId;
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
+import org.reactivestreams.Publisher;
 
 public interface ReactiveMessageSender<T> {
 
-	Mono<MessageId> sendMessage(Mono<MessageSpec<T>> messageSpec);
+	/**
+	 * Send one message.
+	 * @param messageSpec the spec of the message to send
+	 * @return a publisher that will emit one message id and complete
+	 */
+	Publisher<MessageId> send(MessageSpec<T> messageSpec);

Review Comment:
   ```suggestion
   	Mono<MessageId> send(MessageSpec<T> messageSpec);
   ```



##########
pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/ReactiveMessageSender.java:
##########
@@ -17,13 +17,24 @@
 package org.apache.pulsar.reactive.client.api;
 
 import org.apache.pulsar.client.api.MessageId;
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
+import org.reactivestreams.Publisher;
 
 public interface ReactiveMessageSender<T> {
 
-	Mono<MessageId> sendMessage(Mono<MessageSpec<T>> messageSpec);
+	/**
+	 * Send one message.
+	 * @param messageSpec the spec of the message to send
+	 * @return a publisher that will emit one message id and complete
+	 */
+	Publisher<MessageId> send(MessageSpec<T> messageSpec);
 
-	Flux<MessageId> sendMessages(Flux<MessageSpec<T>> messageSpecs);
+	/**
+	 * Send multiple messages and get the associated message ids in the same order as the
+	 * sent messages.
+	 * @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
+	 */
+	Publisher<MessageId> send(Publisher<MessageSpec<T>> messageSpecs);

Review Comment:
   ```suggestion
   	Flux<MessageId> send(Publisher<MessageSpec<T>> messageSpecs);
   ```



-- 
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