public interface PubSubSubscriberOperations
| Modifier and Type | Method and Description |
|---|---|
org.springframework.util.concurrent.ListenableFuture<Void> |
ack(Collection<AcknowledgeablePubsubMessage> acknowledgeablePubsubMessages)
Acknowledge a batch of messages.
|
org.springframework.util.concurrent.ListenableFuture<Void> |
modifyAckDeadline(Collection<AcknowledgeablePubsubMessage> acknowledgeablePubsubMessages,
int ackDeadlineSeconds)
Modify the ack deadline of a batch of messages.
|
org.springframework.util.concurrent.ListenableFuture<Void> |
nack(Collection<AcknowledgeablePubsubMessage> acknowledgeablePubsubMessages)
Negatively acknowledge a batch of messages.
|
List<AcknowledgeablePubsubMessage> |
pull(String subscription,
Integer maxMessages,
Boolean returnImmediately)
Pull a number of messages from a Google Cloud Pub/Sub subscription.
|
List<com.google.pubsub.v1.PubsubMessage> |
pullAndAck(String subscription,
Integer maxMessages,
Boolean returnImmediately)
Pull and auto-acknowledge a number of messages from a Google Cloud Pub/Sub subscription.
|
<T> List<ConvertedAcknowledgeablePubsubMessage<T>> |
pullAndConvert(String subscription,
Integer maxMessages,
Boolean returnImmediately,
Class<T> payloadType)
Pull a number of messages from a Google Cloud Pub/Sub subscription and convert them to Spring messages with
the desired payload type.
|
com.google.pubsub.v1.PubsubMessage |
pullNext(String subscription)
Pull and auto-acknowledge a message from a Google Cloud Pub/Sub subscription.
|
com.google.cloud.pubsub.v1.Subscriber |
subscribe(String subscription,
Consumer<BasicAcknowledgeablePubsubMessage> messageConsumer)
Add a callback method to an existing subscription.
|
com.google.cloud.pubsub.v1.Subscriber |
subscribe(String subscription,
com.google.cloud.pubsub.v1.MessageReceiver messageReceiver)
Deprecated.
as of 1.1, use
subscribe(String, Consumer) instead. |
<T> com.google.cloud.pubsub.v1.Subscriber |
subscribeAndConvert(String subscription,
Consumer<ConvertedBasicAcknowledgeablePubsubMessage<T>> messageConsumer,
Class<T> payloadType)
Add a callback method to an existing subscription that receives Pub/Sub messages converted to the requested
payload type.
|
@Deprecated com.google.cloud.pubsub.v1.Subscriber subscribe(String subscription, com.google.cloud.pubsub.v1.MessageReceiver messageReceiver)
subscribe(String, Consumer) instead.messageReceiver - the message receiver with which to subscribesubscription - the subscription to subscribe tocom.google.cloud.pubsub.v1.Subscriber subscribe(String subscription, Consumer<BasicAcknowledgeablePubsubMessage> messageConsumer)
The created Subscriber is returned so it can be stopped.
subscription - the name of an existing subscriptionmessageConsumer - the callback method triggered when new messages arrive<T> com.google.cloud.pubsub.v1.Subscriber subscribeAndConvert(String subscription, Consumer<ConvertedBasicAcknowledgeablePubsubMessage<T>> messageConsumer, Class<T> payloadType)
The created Subscriber is returned so it can be stopped.
T - the type of the payloadsubscription - the name of an existing subscriptionmessageConsumer - the callback method triggered when new messages arrivepayloadType - the type to which the payload of the Pub/Sub message should be convertedList<com.google.pubsub.v1.PubsubMessage> pullAndAck(String subscription, Integer maxMessages, Boolean returnImmediately)
subscription - the subscription namemaxMessages - the maximum number of pulled messagesreturnImmediately - returns immediately even if subscription doesn't contain enough
messages to satisfy maxMessagesList<AcknowledgeablePubsubMessage> pull(String subscription, Integer maxMessages, Boolean returnImmediately)
subscription - the subscription namemaxMessages - the maximum number of pulled messagesreturnImmediately - returns immediately even if subscription doesn't contain enough
messages to satisfy maxMessages<T> List<ConvertedAcknowledgeablePubsubMessage<T>> pullAndConvert(String subscription, Integer maxMessages, Boolean returnImmediately, Class<T> payloadType)
T - the type of the payloadsubscription - the subscription namemaxMessages - the maximum number of pulled messagesreturnImmediately - returns immediately even if subscription doesn't contain enough
messages to satisfy maxMessagespayloadType - the type to which the payload of the Pub/Sub messages should be convertedcom.google.pubsub.v1.PubsubMessage pullNext(String subscription)
subscription - the subscription namenull if none exists in the subscriptionorg.springframework.util.concurrent.ListenableFuture<Void> ack(Collection<AcknowledgeablePubsubMessage> acknowledgeablePubsubMessages)
acknowledgeablePubsubMessages - messages to be acknowledgedListenableFuture<Void> the ListenableFuture for the asynchronous executionorg.springframework.util.concurrent.ListenableFuture<Void> nack(Collection<AcknowledgeablePubsubMessage> acknowledgeablePubsubMessages)
acknowledgeablePubsubMessages - messages to be negatively acknowledgedListenableFuture<Void> the ListenableFuture for the asynchronous executionorg.springframework.util.concurrent.ListenableFuture<Void> modifyAckDeadline(Collection<AcknowledgeablePubsubMessage> acknowledgeablePubsubMessages, int ackDeadlineSeconds)
acknowledgeablePubsubMessages - messages to be modifiedackDeadlineSeconds - the new ack deadline in seconds. A deadline of 0 effectively nacks the messages.ListenableFuture<Void> the ListenableFuture for the asynchronous executionCopyright © 2019 Pivotal Software, Inc.. All rights reserved.