Skip to content

Commit

Permalink
Added API comments
Browse files Browse the repository at this point in the history
  • Loading branch information
amitjoy committed Sep 10, 2024
1 parent 096be99 commit a3f4f87
Showing 1 changed file with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Message> 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<Message> publishWithReplyMany(Message requestMessage, MessageContext replyToContext);

Expand Down

0 comments on commit a3f4f87

Please sign in to comment.