Skip to content

Commit 54b66ac

Browse files
committed
[ISSUE #51]retain original interface method.
1 parent d21632e commit 54b66ac

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • openmessaging-api/src/main/java/io/openmessaging/consumer

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,18 @@ public interface Consumer extends ServiceLifecycle, Client {
245245
Message receive(String queueName, int partitionId, long offset, long timeout);
246246

247247

248+
/**
249+
* Receive message in asynchronous way. This call doesn't block user's thread, and user's message resolve logic
250+
* should implement in the {@link MessageListener}.
251+
* <p>
252+
*
253+
* @param timeout receive messages will blocked at most <code>timeout</code> milliseconds.
254+
* @return the next batch messages received from the bind queues, or null if the consumer is concurrently shut down.
255+
* @throws OMSSecurityException when have no authority to receive messages from this queue.
256+
* @throws OMSTimeOutException when the given timeout elapses before the send operation completes.
257+
* @throws OMSRuntimeException when the {@code Producer} fails to send the message due to some internal error.
258+
*/
259+
List<Message> batchReceive(long timeout);
248260

249261
/**
250262
* Receive message in asynchronous way. This call doesn't block user's thread, and user's message resolve logic

0 commit comments

Comments
 (0)