openmessaging-java icon indicating copy to clipboard operation
openmessaging-java copied to clipboard

MessageReceipt should have getMessageId and getOffset api

Open odbozhou opened this issue 6 years ago • 0 comments

In the openmessaging-java api, MessageReceipt is mainly used in the following APIs

void ack(MessageReceipt receipt);
Message receive(String queueName, QueueMetaData queueMetaData, MessageReceipt messageReceipt, long timeout);
List<Message> batchReceive(String queueName, QueueMetaData queueMetaData, MessageReceipt messageReceipt,

But MessageReceipt is an empty interface,when used in ACK api, it should have get messageId API to confirmation message,when used in receive api, it should have getOffset API to pull message by offset,Otherwise, the API is not very useful and must be forced to convert to an implementation class, which obviously violates the Interface-oriented programming.

odbozhou avatar Jun 03 '19 11:06 odbozhou