Skip to content

Commit

Permalink
Added missing comments to Message Publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
amitjoy committed Jun 21, 2024
1 parent e1b5b47 commit df7cea8
Showing 1 changed file with 27 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,36 @@

import org.osgi.annotation.versioning.ProviderType;

/**
* A service interface for publishing messages to specific topics.
* This interface allows publishing messages with or without specifying a target topic
* and provides flexibility to override message context settings.
*/
@ProviderType
public interface MessagePublisher {

/**
* Publish the given {@link Message} to the given topic contained in the message
* context of the message
*
* @param message the {@link Message} to publish
*/
void publish(Message message);
/**
* Publishes the given {@link Message} to the topic specified in the message's context.
*
* @param message the {@link Message} to publish
*/
void publish(Message message);

/**
* Publish the given {@link Message} to the given topic
*
* @param message the {@link Message} to publish
* @param channel the topic to publish the message to
*/
void publish(Message message, String channel);
/**
* Publishes the given {@link Message} to the specified topic.
*
* @param message the {@link Message} to publish
* @param channel the topic to publish the message to
*/
void publish(Message message, String channel);

/**
* Publish the given {@link Message} using the given {@link MessageContext}. The
* context parameter will override all context information, that come with the
* message’s Message#getContext information
*
* @param message the {@link Message} to send
* @param context the {@link MessageContext} to be used
*/
void publish(Message message, MessageContext context);
/**
* Publishes the given {@link Message} using the specified {@link MessageContext}.
* This context parameter overrides any context information provided by the message itself.
*
* @param message the {@link Message} to publish
* @param context the {@link MessageContext} to be used for publishing
*/
void publish(Message message, MessageContext context);

}
}

0 comments on commit df7cea8

Please sign in to comment.