Skip to content

Commit 51a9a80

Browse files
authored
small doc and naming fixes (#1556)
1 parent 23890bf commit 51a9a80

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageReceiver.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,22 @@
1919
import com.google.common.util.concurrent.ListenableFuture;
2020
import com.google.pubsub.v1.PubsubMessage;
2121

22-
/** Users of the {@link Subscriber} must implement this interface to receive messages. */
22+
/** This interface can be implemented by users of {@link Subscriber} to receive messages. */
2323
public interface MessageReceiver {
24-
enum AckReply {
25-
/** To be used for acking a message. */
24+
/** A reply to a message, to be sent back to the service. */
25+
enum AckReply {
26+
/**
27+
* Acknowledges that the message has been successfully processed. The service will not send the
28+
* message again.
29+
*/
2630
ACK,
27-
/** To be used for nacking a message. */
31+
/**
32+
* Signals that the message has not been successfully processed. The service will resend the
33+
* message.
34+
*/
2835
NACK
2936
}
37+
3038
/**
3139
* Called when a message is received by the subscriber.
3240
*

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@
110110
*/
111111
public class Publisher {
112112
/** The maximum number of messages in one request. Defined by the API. */
113-
public static long getApiMaxBundleMessages() {
113+
public static long getApiMaxRequestElementCount() {
114114
return 1000L;
115115
}
116116

117117
/** The maximum size of one request. Defined by the API. */
118-
public static long getApiMaxBundleBytes() {
118+
public static long getApiMaxRequestBytes() {
119119
return 10L * 1000L * 1000L; // 10 megabytes (https://en.wikipedia.org/wiki/Megabyte)
120120
}
121121

@@ -194,7 +194,7 @@ public void close() throws IOException {
194194
messagesWaiter = new MessagesWaiter();
195195
}
196196

197-
/** Topic to which the publisher publishes to. */
197+
/** Topic which the publisher publishes to. */
198198
public String getTopic() {
199199
return topic;
200200
}

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Subscriber.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,17 @@ public SubscriberStats getStats() {
370370
return null;
371371
}
372372

373+
/** Subscription which the subscriber is subscribed to. */
373374
public String getSubscription() {
374375
return subscription;
375376
}
376377

378+
/** Acknowledgement expiration padding. See {@link Builder.setAckExpirationPadding}. */
377379
public Duration getAckExpirationPadding() {
378380
return ackExpirationPadding;
379381
}
380382

383+
/** The flow control settings the Subscriber is configured with. */
381384
public FlowController.Settings getFlowControlSettings() {
382385
return flowControlSettings;
383386
}

0 commit comments

Comments
 (0)