Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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();
}