Skip to content

Commit efefaed

Browse files
committed
remove outdated sample
1 parent cc156a6 commit efefaed

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import com.google.api.core.ApiFutureCallback;
2626
import com.google.api.core.ApiFutures;
2727
import com.google.api.gax.batching.BatchingSettings;
28-
import com.google.api.gax.batching.FlowControlSettings;
29-
import com.google.api.gax.batching.FlowController.LimitExceededBehavior;
3028
import com.google.api.gax.core.CredentialsProvider;
3129
import com.google.api.gax.core.FixedCredentialsProvider;
3230
import com.google.api.gax.grpc.ChannelProvider;
@@ -125,28 +123,6 @@ public Publisher getPublisherWithCustomRetrySettings(TopicName topicName) throws
125123
return publisher;
126124
}
127125

128-
public Publisher getPublisherWithCustomFlowControlSettings(TopicName topicName) throws Exception {
129-
// [START pubsub_publisher_flow_settings]
130-
131-
// Flow control settings restrict the number of outstanding publish requests
132-
int maxOutstandingBatches = 20;
133-
int maxOutstandingRequestBytes = 500000;
134-
135-
// override behavior on limits exceeded if needed, default behavior is to block
136-
LimitExceededBehavior limitExceededBehavior = LimitExceededBehavior.ThrowException;
137-
138-
FlowControlSettings flowControlSettings = FlowControlSettings.newBuilder()
139-
.setMaxOutstandingElementCount(maxOutstandingBatches)
140-
.setMaxOutstandingRequestBytes(maxOutstandingRequestBytes)
141-
.setLimitExceededBehavior(limitExceededBehavior)
142-
.build();
143-
144-
Publisher publisher = Publisher.defaultBuilder(topicName)
145-
.setFlowControlSettings(flowControlSettings).build();
146-
// [END pubsub_publisher_flow_settings]
147-
return publisher;
148-
}
149-
150126
public Publisher getSingleThreadedPublisher(TopicName topicName) throws Exception {
151127
// [START pubsub_publisher_single_threaded]
152128
// create a publisher with a single threaded executor

0 commit comments

Comments
 (0)