Skip to content

Commit ccdc84b

Browse files
committed
[ISSUE #51]adjust some parameters name in the receive and batch receive method.
1 parent 54b66ac commit ccdc84b

File tree

1 file changed

+6
-5
lines changed
  • openmessaging-api/src/main/java/io/openmessaging/consumer

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import io.openmessaging.Client;
2121
import io.openmessaging.MessagingAccessPoint;
2222
import io.openmessaging.ServiceLifecycle;
23+
import io.openmessaging.annotation.Optional;
2324
import io.openmessaging.exception.OMSDestinationException;
2425
import io.openmessaging.exception.OMSRuntimeException;
2526
import io.openmessaging.exception.OMSSecurityException;
@@ -228,21 +229,21 @@ public interface Consumer extends ServiceLifecycle, Client {
228229
Message receive(long timeout);
229230

230231
/**
231-
* Receives the next message from the which bind queue,partition and offset of this consumer in pull model.
232+
* Receives the next message from the which bind queue,partition and receiptId of this consumer in pull model.
232233
* <p>
233234
* This call blocks indefinitely until a message is arrives, the timeout expires, or until this {@code PullConsumer}
234235
* is shut down.
235236
*
236237
* @param queueName receive message from which queueName in Message Queue.
237238
* @param partitionId receive message from which partition in Message Queue.
238-
* @param offset receive message from which offset in Message Queue.
239+
* @param receiptId receive message from which receipt position in Message Queue.
239240
* @param timeout receive message will blocked at most <code>timeout</code> milliseconds.
240241
* @return the next message received from the bind queues, or null if the consumer is concurrently shut down.
241242
* @throws OMSSecurityException when have no authority to receive messages from this queue.
242243
* @throws OMSTimeOutException when the given timeout elapses before the send operation completes.
243244
* @throws OMSRuntimeException when the {@code Producer} fails to send the message due to some internal error.
244245
*/
245-
Message receive(String queueName, int partitionId, long offset, long timeout);
246+
Message receive(String queueName,@Optional int partitionId, long receiptId, long timeout);
246247

247248

248249
/**
@@ -265,14 +266,14 @@ public interface Consumer extends ServiceLifecycle, Client {
265266
*
266267
* @param queueName receive message from which queueName in Message Queue.
267268
* @param partitionId receive message from which partition in Message Queue.
268-
* @param offset receive message from which offset in Message Queue.
269+
* @param receiptId receive message from which receipt position in Message Queue.
269270
* @param timeout receive messages will blocked at most <code>timeout</code> milliseconds.
270271
* @return the next batch messages received from the bind queues, or null if the consumer is concurrently shut down.
271272
* @throws OMSSecurityException when have no authority to receive messages from this queue.
272273
* @throws OMSTimeOutException when the given timeout elapses before the send operation completes.
273274
* @throws OMSRuntimeException when the {@code Producer} fails to send the message due to some internal error.
274275
*/
275-
List<Message> batchReceive(String queueName, int partitionId, long offset, long timeout);
276+
List<Message> batchReceive(String queueName,@Optional int partitionId, long receiptId, long timeout);
276277

277278
/**
278279
* Acknowledges the specified and consumed message with the unique message receipt handle, in the scenario of using

0 commit comments

Comments
 (0)