20
20
21
21
import com .google .cloud .pubsub .spi .v1 .SubscriberClient ;
22
22
import com .google .common .base .MoreObjects ;
23
-
24
23
import java .io .Serializable ;
25
24
import java .util .Objects ;
26
- import java .util .concurrent .TimeUnit ;
27
25
28
26
/**
29
27
* A Google Cloud Pub/Sub subscription. A subscription represents the stream of messages from a
36
34
* processed and the Pub/Sub system can delete it from the subscription; a non-success response
37
35
* indicates that the Pub/Sub server should resend it (implicit "nack").
38
36
*
39
- * <p>In a pull subscription, the subscribing application must explicitly pull messages using one of
40
- * {@link PubSub#pull(String, int)}, {@link PubSub#pullAsync(String, int)} or
41
- * {@link PubSub#pullAsync(String, PubSub.MessageProcessor callback, PubSub.PullOption...)}.
42
- * When messages are pulled with {@link PubSub#pull(String, int)} or
43
- * {@link PubSub#pullAsync(String, int)} the subscribing application must also explicitly
44
- * acknowledge them using one of {@link PubSub#ack(String, Iterable)},
45
- * {@link PubSub#ack(String, String, String...)}, {@link PubSub#ackAsync(String, Iterable)} or
46
- * {@link PubSub#ackAsync(String, String, String...)}.
37
+ * <p>In a pull subscription, the subscribing application must pull messages using {@link
38
+ * PubSub#getSubscriber(SubscriptionInfo, Subscriber.MessageReceiver)}.
47
39
*
48
40
* @see <a href="https://cloud.google.com/pubsub/overview#data_model">Pub/Sub Data Model</a>
49
41
* @see <a href="https://cloud.google.com/pubsub/subscriber">Subscriber Guide</a>
@@ -140,10 +132,10 @@ public abstract static class Builder {
140
132
* acknowledge the message. After message delivery but before the ack deadline expires and
141
133
* before the message is acknowledged, it is an outstanding message and will not be delivered
142
134
* again during that time (on a best-effort basis). For pull subscriptions, this value is used
143
- * as the initial value for the ack deadline. To override the ack deadline value for a given
144
- * message, use {@link PubSub#modifyAckDeadline(String, int, TimeUnit, Iterable)}. For push
145
- * delivery, this value is used to set the request timeout for the call to the push endpoint.
146
- * This value must be between 10 and 600 seconds, if not specified, 10 seconds is used.
135
+ * as the initial value for the ack deadline, and {@link Subscriber} automatically renews
136
+ * unprocessed messages. For push delivery, this value is used to set the request timeout for
137
+ * the call to the push endpoint. This value must be between 10 and 600 seconds, if not
138
+ * specified, 10 seconds is used.
147
139
*/
148
140
@ Deprecated
149
141
public abstract Builder ackDeadLineSeconds (int ackDeadLineSeconds );
@@ -153,10 +145,10 @@ public abstract static class Builder {
153
145
* acknowledge the message. After message delivery but before the ack deadline expires and
154
146
* before the message is acknowledged, it is an outstanding message and will not be delivered
155
147
* again during that time (on a best-effort basis). For pull subscriptions, this value is used
156
- * as the initial value for the ack deadline. To override the ack deadline value for a given
157
- * message, use {@link PubSub#modifyAckDeadline(String, int, TimeUnit, Iterable)}. For push
158
- * delivery, this value is used to set the request timeout for the call to the push endpoint.
159
- * This value must be between 10 and 600 seconds, if not specified, 10 seconds is used.
148
+ * as the initial value for the ack deadline. , and {@link Subscriber} automatically renews
149
+ * unprocessed messages. For push delivery, this value is used to set the request timeout for
150
+ * the call to the push endpoint. This value must be between 10 and 600 seconds, if not
151
+ * specified, 10 seconds is used.
160
152
*/
161
153
public abstract Builder setAckDeadLineSeconds (int ackDeadLineSeconds );
162
154
@@ -333,13 +325,13 @@ public PushConfig getPushConfig() {
333
325
334
326
/**
335
327
* Returns the maximum time after a subscriber receives a message before the subscriber should
336
- * acknowledge the message. After message delivery but before the ack deadline expires and
337
- * before the message is acknowledged, it is an outstanding message and will not be delivered
338
- * again during that time (on a best-effort basis). For pull subscriptions, this value is used
339
- * as the initial value for the ack deadline. To override the ack deadline value for a given
340
- * message, use {@link PubSub#modifyAckDeadline(String, int, TimeUnit, Iterable)}. For push
341
- * delivery, this value is used to set the request timeout for the call to the push endpoint. This
342
- * value must be between 10 and 600 seconds, if not specified, 10 seconds is used.
328
+ * acknowledge the message. After message delivery but before the ack deadline expires and before
329
+ * the message is acknowledged, it is an outstanding message and will not be delivered again
330
+ * during that time (on a best-effort basis). For pull subscriptions, this value is used as the
331
+ * initial value for the ack deadline, and {@link Subscriber} automatically renews unprocessed
332
+ * messages. For push delivery, this value is used to set the request timeout for the call to the
333
+ * push endpoint. This value must be between 10 and 600 seconds, if not specified, 10 seconds is
334
+ * used.
343
335
*/
344
336
@ Deprecated
345
337
public long ackDeadlineSeconds () {
@@ -348,13 +340,13 @@ public long ackDeadlineSeconds() {
348
340
349
341
/**
350
342
* Returns the maximum time after a subscriber receives a message before the subscriber should
351
- * acknowledge the message. After message delivery but before the ack deadline expires and
352
- * before the message is acknowledged, it is an outstanding message and will not be delivered
353
- * again during that time (on a best-effort basis). For pull subscriptions, this value is used
354
- * as the initial value for the ack deadline. To override the ack deadline value for a given
355
- * message, use {@link PubSub#modifyAckDeadline(String, int, TimeUnit, Iterable)}. For push
356
- * delivery, this value is used to set the request timeout for the call to the push endpoint. This
357
- * value must be between 10 and 600 seconds, if not specified, 10 seconds is used.
343
+ * acknowledge the message. After message delivery but before the ack deadline expires and before
344
+ * the message is acknowledged, it is an outstanding message and will not be delivered again
345
+ * during that time (on a best-effort basis). For pull subscriptions, this value is used as the
346
+ * initial value for the ack deadline, and {@link Subscriber} automatically renews unprocessed
347
+ * messages. For push delivery, this value is used to set the request timeout for the call to the
348
+ * push endpoint. This value must be between 10 and 600 seconds, if not specified, 10 seconds is
349
+ * used.
358
350
*/
359
351
public long getAckDeadlineSeconds () {
360
352
return ackDeadlineSeconds ;
0 commit comments