diff --git a/org.osgi.service.messaging/src/main/java/org/osgi/service/messaging/replyto/ReplyToManyPublisher.java b/org.osgi.service.messaging/src/main/java/org/osgi/service/messaging/replyto/ReplyToManyPublisher.java index d7cb928..9c6e1f2 100644 --- a/org.osgi.service.messaging/src/main/java/org/osgi/service/messaging/replyto/ReplyToManyPublisher.java +++ b/org.osgi.service.messaging/src/main/java/org/osgi/service/messaging/replyto/ReplyToManyPublisher.java @@ -5,31 +5,38 @@ import org.osgi.service.messaging.MessageContext; import org.osgi.util.pushstream.PushStream; +/** + * The {@code ReplyToManyPublisher} interface provides a way to publish a request + * message and receive multiple asynchronous responses. It enables sending a request + * to a messaging system and obtaining a stream of responses via a {@link PushStream}. + * This interface supports both simple message requests and requests with additional + * context for more detailed control over request and response handling. + */ @ProviderType public interface ReplyToManyPublisher { /** - * Subscribe for multiple responses on a reply-to request. This call is similar - * to the simple subscription to a topic. This request message contains payload - * and parameters, like e.g. correlation id or response channel for the request, + * Publishes a request message and subscribes for multiple responses on a + * reply-to request. This method is similar to subscribing to a topic but + * allows for multiple responses. The request message contains payload and + * parameters, such as a correlation ID or response channel for request and * response setup. * - * @param requestMessage the request message - * @return the {@link PushStream} for the answer stream + * @param requestMessage the request message to be sent + * @return the {@link PushStream} that represents the stream of multiple responses */ PushStream publishWithReplyMany(Message requestMessage); /** - * Publish a request and await multiple answers for that request. + * Publishes a request message with additional context and subscribes for + * multiple responses. This method is similar to subscribing to a topic, but + * it provides an opportunity to include a specific context for request and + * response handling. The request message contains payload and parameters, + * such as a correlation ID or response channel for request and response setup. * - * This call is similar to the simple subscription on a topic. This request - * message contains payload and parameters, like e.g. correlation id or response - * channel for the request, response setup. - * - * @param requestMessage the request message - * @param replyToContext the properties in the context for the request and - * response setup - * @return the {@link PushStream} for the answer stream + * @param requestMessage the request message to be sent + * @param replyToContext the context properties to use for request and response setup + * @return the {@link PushStream} that represents the stream of multiple responses */ PushStream publishWithReplyMany(Message requestMessage, MessageContext replyToContext);