File tree Expand file tree Collapse file tree
branches/autosynth-errorreporting/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
129129refs/heads/autosynth-containeranalysis: 18d210f81f17cf74864d0db2c29e834302f74f2a
130130refs/heads/autosynth-datastore: f1efc3dc465174f41041acd56cf29badcec3e5bd
131131refs/heads/autosynth-dialogflow: 73974cc32e5212aec0126472e0bc1442886fedaf
132- refs/heads/autosynth-errorreporting: 909d0944c96347814c3ec56cb36fbd0c14f700a1
132+ refs/heads/autosynth-errorreporting: 8894854f9bcd487769ad9f38ce441a88577a4cf3
133133refs/heads/autosynth-firestore: 983c75e4fb1076502c8cac73ef0538bdb10884f3
134134refs/heads/autosynth-iot: 4025d1804241e74d54950a324dc4f667aeaad4b3
135135refs/heads/autosynth-kms: 6b65b0f34c12d141031c7288cdc01e550212d0f6
Original file line number Diff line number Diff line change @@ -304,15 +304,18 @@ public void publishAllOutstanding() {
304304 publishOutstandingBatch (batchToSend );
305305 }
306306
307- private void publishOutstandingBatch ( final OutstandingBatch outstandingBatch ) {
307+ private ApiFuture < PublishResponse > publishCall ( OutstandingBatch outstandingBatch ) {
308308 PublishRequest .Builder publishRequest = PublishRequest .newBuilder ();
309309 publishRequest .setTopic (topicName );
310310 for (OutstandingPublish outstandingPublish : outstandingBatch .outstandingPublishes ) {
311311 publishRequest .addMessages (outstandingPublish .message );
312312 }
313313
314- ApiFutures .addCallback (
315- publisherStub .publishCallable ().futureCall (publishRequest .build ()),
314+ return publisherStub .publishCallable ().futureCall (publishRequest .build ());
315+ }
316+
317+ private void publishOutstandingBatch (final OutstandingBatch outstandingBatch ) {
318+ ApiFutureCallback <PublishResponse > futureCallback =
316319 new ApiFutureCallback <PublishResponse >() {
317320 @ Override
318321 public void onSuccess (PublishResponse result ) {
@@ -351,8 +354,9 @@ public void onFailure(Throwable t) {
351354 messagesWaiter .incrementPendingMessages (-outstandingBatch .size ());
352355 }
353356 }
354- },
355- directExecutor ());
357+ };
358+
359+ ApiFutures .addCallback (publishCall (outstandingBatch ), futureCallback , directExecutor ());
356360 }
357361
358362 private static final class OutstandingBatch {
You can’t perform that action at this time.
0 commit comments