public interface Subscriber extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
commit(String id)
Commits allow clients to implement at least once, at most once or exactly once semantics when processing messages.
|
void |
fail(String id)
Marks the processing of the
PubSubMessage with the given id as failed. |
PubSubMessage |
receive()
Gets a new
PubSubMessage from the assigned partition/partitions (Here a partition is a unit of
parallelism in the Pub/Sub queue, See PubSub ). |
close
PubSubMessage receive() throws PubSubException
PubSubMessage
from the assigned partition/partitions (Here a partition is a unit of
parallelism in the Pub/Sub queue, See PubSub
).PubSubMessage
.PubSubException
- when a receive fails.void commit(String id)
id
- The ID of the message to be marked as committed.void fail(String id)
PubSubMessage
with the given id as failed.id
- The ID of the PubSubMessage to mark as a processing failure.Copyright © 2021. All rights reserved.