Skip to content

Commit 6416ff6

Browse files
committed
small doc and naming fixes
1 parent 1c80923 commit 6416ff6

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

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
@@ -109,12 +109,12 @@
109109
*/
110110
public class Publisher {
111111
/** The maximum number of messages in one request. Defined by the API. */
112-
public static long getApiMaxBundleMessages() {
112+
public static long getApiMaxRequestElementCount() {
113113
return 1000L;
114114
}
115115

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

@@ -193,7 +193,7 @@ private Publisher(Builder builder) throws IOException {
193193
messagesWaiter = new MessagesWaiter();
194194
}
195195

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

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
@@ -361,14 +361,17 @@ public SubscriberStats getStats() {
361361
return null;
362362
}
363363

364+
/** Subscription which the subscriber is subscribed to. */
364365
public String getSubscription() {
365366
return subscription;
366367
}
367368

369+
/** Acknowledgement expiration padding. See {@link Builder.setAckExpirationPadding}. */
368370
public Duration getAckExpirationPadding() {
369371
return ackExpirationPadding;
370372
}
371373

374+
/** The flow control settings the Subscriber is configured with. */
372375
public FlowController.Settings getFlowControlSettings() {
373376
return flowControlSettings;
374377
}

0 commit comments

Comments
 (0)