Skip to content

Commit da3bb70

Browse files
committed
[ISSUES 55] MessageReceipt should have getMessageId and getOffset API
(openmessaging#55)
1 parent 9987e91 commit da3bb70

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

openmessaging-api/src/main/java/io/openmessaging/consumer/MessageReceipt.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,41 @@
1717

1818
package io.openmessaging.consumer;
1919

20+
import io.openmessaging.message.Header;
21+
2022
/**
2123
* A {@code MessageReceipt} is a {@code Message} with a {@code Receipt}.
2224
*
2325
* @version OMS 1.0.0
2426
* @since OMS 1.0.0
2527
*/
2628
public interface MessageReceipt {
29+
/**
30+
* {@code OFFSET} represents this message offset in partition.
31+
* <p>
32+
*
33+
* @param offset The offset in the current partition, used to quickly get this message in the queue
34+
*/
35+
void setOffset(long offset);
36+
37+
/**
38+
* This method will return the {@code OFFSET} in the partition to which the message belongs to, but the premise is
39+
* that the implementation of the server side is dependent on the partition or a queue-like storage mechanism.
40+
*
41+
* @return The offset of the partition to which the message belongs.
42+
*/
43+
long getOffset();
44+
45+
/**
46+
* The {@code MESSAGE_ID} header field contains a value that uniquely identify each message sent by a {@code
47+
* Producer}. this identifier is generated by producer.
48+
*/
49+
void setMessageId(String messageId);
50+
51+
/**
52+
* See {@link Header#setMessageId(String)}
53+
*
54+
* @return messageId
55+
*/
56+
String getMessageId();
2757
}

0 commit comments

Comments
 (0)