5454 * in memory before the receiver either ack or nack them.
5555 * </ul>
5656 *
57- * <p>If no credentials are provided, the {@link Publisher } will use application default credentials
58- * through {@link GoogleCredentials#getApplicationDefault}.
57+ * <p>If no credentials are provided, the {@link Subscriber } will use application default
58+ * credentials through {@link GoogleCredentials#getApplicationDefault}.
5959 *
6060 * <p>For example, a {@link Subscriber} can be constructed and used to receive messages as follows:
6161 *
62- * <pre>{@ code
62+ * <pre>< code>
6363 * MessageReceiver receiver = new MessageReceiver() {
64- * @ Override
65- * public ListenableFuture< AckReply> receiveMessage(PubsubMessage message) {
64+ * @ Override
65+ * public ListenableFuture< AckReply> receiveMessage(PubsubMessage message) {
6666 * // ... process message ...
6767 * return Futures.immediateFuture(AckReply.ACK);
6868 * }
7777 *
7878 * // ... recommended, listen for fatal errors that break the subscriber streaming ...
7979 * subscriber.addListener(new Listener() {
80- * @ Override
80+ * @ Override
8181 * public void failed(State from, Throwable failure) {
82- * System.out.println("Subscriber faile with error: " + failure);
82+ * System.out.println("Subscriber failed with error: " + failure);
8383 * }
8484 * }, Executors.newSingleThreadExecutor());
8585 *
8686 * // ... and when done with the subscriber ...
8787 * subscriber.stopAsync();
88- * } </pre>
88+ * </code> </pre>
8989 */
9090public interface Subscriber extends Service {
91- String PUBSUB_API_ADDRESS = "pubsub.googleapis.com" ;
92- String PUBSUB_API_SCOPE = "https://www.googleapis.com/auth/pubsub" ;
93-
9491 /** Retrieves a snapshot of the current subscriber statistics. */
9592 SubscriberStats getStats ();
9693
@@ -125,15 +122,15 @@ public static enum AckReply {
125122 Duration getAckExpirationPadding ();
126123
127124 /**
128- * Maximum number of outstanding (i.e. pending to process) messages before limits are enforced.
125+ * Maximum number of outstanding messages before limits are enforced.
129126 *
130127 * <p><b>When limits are enforced, no more messages will be dispatched to the {@link
131128 * MessageReceiver} but due to the gRPC and HTTP/2 buffering and congestion control window
132129 * management, still some extra bytes could be kept at lower layers.</b>
133130 */
134131 Optional <Integer > getMaxOutstandingElementCount ();
135132
136- /** Maximum number of outstanding (i.e. pending to process) bytes before limits are enforced. */
133+ /** Maximum number of outstanding bytes before limits are enforced. */
137134 Optional <Integer > getMaxOutstandingRequestBytes ();
138135
139136 /** Builder of {@link Subscriber Subscribers}. */
@@ -158,7 +155,7 @@ public final class Builder {
158155 * Constructs a new {@link Builder}.
159156 *
160157 * <p>Once {@link #build()} is called a gRPC stub will be created for use of the {@link
161- * Publisher }.
158+ * Subscriber }.
162159 *
163160 * @param subscription Cloud Pub/Sub subscription to bind the subscriber to
164161 * @param receiver an implementation of {@link MessageReceiver} used to process the received
@@ -226,8 +223,8 @@ public Builder setExecutor(ScheduledExecutorService executor) {
226223 return this ;
227224 }
228225
229- /** Gives the ability to set a custom executor . */
230- public Builder setClock (Clock clock ) {
226+ /** Gives the ability to set a custom clock . */
227+ Builder setClock (Clock clock ) {
231228 this .clock = Optional .of (clock );
232229 return this ;
233230 }
0 commit comments