Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #55] MessageReceipt should have getMessageId and getOffset API #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,41 @@

package io.openmessaging.consumer;

import io.openmessaging.message.Header;

/**
* A {@code MessageReceipt} is a {@code Message} with a {@code Receipt}.
*
* @version OMS 1.0.0
* @since OMS 1.0.0
*/
public interface MessageReceipt {
/**
* {@code OFFSET} represents this message offset in partition.
* <p>
*
* @param offset The offset in the current partition, used to quickly get this message in the queue
*/
void setOffset(long offset);

/**
* This method will return the {@code OFFSET} in the partition to which the message belongs to, but the premise is
* that the implementation of the server side is dependent on the partition or a queue-like storage mechanism.
*
* @return The offset of the partition to which the message belongs.
*/
long getOffset();

/**
* The {@code MESSAGE_ID} header field contains a value that uniquely identify each message sent by a {@code
* Producer}. this identifier is generated by producer.
*/
void setMessageId(String messageId);

/**
* See {@link Header#setMessageId(String)}
*
* @return messageId
*/
String getMessageId();
}