Skip to content

Commit

Permalink
Fix the default maxInboundMessageSize config via synth
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 committed Dec 5, 2018
1 parent f4d0516 commit 2e97a70
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package com.google.pubsub.v1;


// AUTO-GENERATED DOCUMENTATION AND CLASS
@javax.annotation.Generated("by GAPIC protoc plugin")
public class TopicNames {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde

/** Returns a builder for the default ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return InstantiatingGrpcChannelProvider.newBuilder();
return InstantiatingGrpcChannelProvider.newBuilder().setMaxInboundMessageSize(20 << 20); // 20MB
}

public static TransportChannelProvider defaultTransportChannelProvider() {
Expand Down
6 changes: 6 additions & 0 deletions google-cloud-clients/google-cloud-pubsub/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src')
s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')

s.replace(
'**/stub/SubscriberStubSettings.java',
r'return InstantiatingGrpcChannelProvider\.newBuilder\(\);',
'return InstantiatingGrpcChannelProvider.newBuilder().setMaxInboundMessageSize(20 << 20); // 20MB'
)

java.format_code('./src')
java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src')
java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')

0 comments on commit 2e97a70

Please sign in to comment.