Skip to content

Commit d1b3740

Browse files
fix: remove grpc send/recieve limits (#259)
1 parent faf4fe4 commit d1b3740

File tree

11 files changed

+55
-10
lines changed

11 files changed

+55
-10
lines changed

packages/google-cloud-pubsub/google/pubsub_v1/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
"ModifyPushConfigRequest",
9191
"PublishRequest",
9292
"PublishResponse",
93-
"PublisherClient",
9493
"PubsubMessage",
9594
"PullRequest",
9695
"PullResponse",
@@ -102,10 +101,11 @@
102101
"Snapshot",
103102
"StreamingPullRequest",
104103
"StreamingPullResponse",
104+
"SubscriberClient",
105105
"Subscription",
106106
"Topic",
107107
"UpdateSnapshotRequest",
108108
"UpdateSubscriptionRequest",
109109
"UpdateTopicRequest",
110-
"SubscriberClient",
110+
"PublisherClient",
111111
)

packages/google-cloud-pubsub/google/pubsub_v1/services/publisher/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
_transport_registry["grpc"] = PublisherGrpcTransport
2929
_transport_registry["grpc_asyncio"] = PublisherGrpcAsyncIOTransport
3030

31-
3231
__all__ = (
3332
"PublisherTransport",
3433
"PublisherGrpcTransport",

packages/google-cloud-pubsub/google/pubsub_v1/services/publisher/transports/grpc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ def __init__(
150150
ssl_credentials=ssl_credentials,
151151
scopes=scopes or self.AUTH_SCOPES,
152152
quota_project_id=quota_project_id,
153+
options=[
154+
("grpc.max_send_message_length", -1),
155+
("grpc.max_receive_message_length", -1),
156+
],
153157
)
154158
self._ssl_channel_credentials = ssl_credentials
155159
else:
@@ -168,6 +172,10 @@ def __init__(
168172
ssl_credentials=ssl_channel_credentials,
169173
scopes=scopes or self.AUTH_SCOPES,
170174
quota_project_id=quota_project_id,
175+
options=[
176+
("grpc.max_send_message_length", -1),
177+
("grpc.max_receive_message_length", -1),
178+
],
171179
)
172180

173181
self._stubs = {} # type: Dict[str, Callable]
@@ -194,7 +202,7 @@ def create_channel(
194202
) -> grpc.Channel:
195203
"""Create and return a gRPC channel object.
196204
Args:
197-
address (Optionsl[str]): The host for the channel to use.
205+
address (Optional[str]): The host for the channel to use.
198206
credentials (Optional[~.Credentials]): The
199207
authorization credentials to attach to requests. These
200208
credentials identify this application to the service. If

packages/google-cloud-pubsub/google/pubsub_v1/services/publisher/transports/grpc_asyncio.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ def __init__(
195195
ssl_credentials=ssl_credentials,
196196
scopes=scopes or self.AUTH_SCOPES,
197197
quota_project_id=quota_project_id,
198+
options=[
199+
("grpc.max_send_message_length", -1),
200+
("grpc.max_receive_message_length", -1),
201+
],
198202
)
199203
self._ssl_channel_credentials = ssl_credentials
200204
else:
@@ -213,6 +217,10 @@ def __init__(
213217
ssl_credentials=ssl_channel_credentials,
214218
scopes=scopes or self.AUTH_SCOPES,
215219
quota_project_id=quota_project_id,
220+
options=[
221+
("grpc.max_send_message_length", -1),
222+
("grpc.max_receive_message_length", -1),
223+
],
216224
)
217225

218226
# Run the base constructor.

packages/google-cloud-pubsub/google/pubsub_v1/services/subscriber/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
_transport_registry["grpc"] = SubscriberGrpcTransport
2929
_transport_registry["grpc_asyncio"] = SubscriberGrpcAsyncIOTransport
3030

31-
3231
__all__ = (
3332
"SubscriberTransport",
3433
"SubscriberGrpcTransport",

packages/google-cloud-pubsub/google/pubsub_v1/services/subscriber/transports/grpc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ def __init__(
152152
ssl_credentials=ssl_credentials,
153153
scopes=scopes or self.AUTH_SCOPES,
154154
quota_project_id=quota_project_id,
155+
options=[
156+
("grpc.max_send_message_length", -1),
157+
("grpc.max_receive_message_length", -1),
158+
],
155159
)
156160
self._ssl_channel_credentials = ssl_credentials
157161
else:
@@ -170,6 +174,10 @@ def __init__(
170174
ssl_credentials=ssl_channel_credentials,
171175
scopes=scopes or self.AUTH_SCOPES,
172176
quota_project_id=quota_project_id,
177+
options=[
178+
("grpc.max_send_message_length", -1),
179+
("grpc.max_receive_message_length", -1),
180+
],
173181
)
174182

175183
self._stubs = {} # type: Dict[str, Callable]
@@ -196,7 +204,7 @@ def create_channel(
196204
) -> grpc.Channel:
197205
"""Create and return a gRPC channel object.
198206
Args:
199-
address (Optionsl[str]): The host for the channel to use.
207+
address (Optional[str]): The host for the channel to use.
200208
credentials (Optional[~.Credentials]): The
201209
authorization credentials to attach to requests. These
202210
credentials identify this application to the service. If

packages/google-cloud-pubsub/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ def __init__(
197197
ssl_credentials=ssl_credentials,
198198
scopes=scopes or self.AUTH_SCOPES,
199199
quota_project_id=quota_project_id,
200+
options=[
201+
("grpc.max_send_message_length", -1),
202+
("grpc.max_receive_message_length", -1),
203+
],
200204
)
201205
self._ssl_channel_credentials = ssl_credentials
202206
else:
@@ -215,6 +219,10 @@ def __init__(
215219
ssl_credentials=ssl_channel_credentials,
216220
scopes=scopes or self.AUTH_SCOPES,
217221
quota_project_id=quota_project_id,
222+
options=[
223+
("grpc.max_send_message_length", -1),
224+
("grpc.max_receive_message_length", -1),
225+
],
218226
)
219227

220228
# Run the base constructor.

packages/google-cloud-pubsub/google/pubsub_v1/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
SeekResponse,
6262
)
6363

64-
6564
__all__ = (
6665
"MessageStoragePolicy",
6766
"Topic",

packages/google-cloud-pubsub/synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-pubsub.git",
7-
"sha": "f3f4e5add32128bf238b2fbab3bcf0f5b23269d3"
7+
"sha": "258414727827e56d2678ada28b9bbd88b5c6aa6f"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "53eb2512a55caabcbad1898225080a2a3dfcb6aa",
15-
"internalRef": "346818879"
14+
"sha": "0509f4bc8c86495f50a92f536bddc625797eda63",
15+
"internalRef": "347398860"
1616
}
1717
},
1818
{

packages/google-cloud-pubsub/tests/unit/gapic/pubsub_v1/test_publisher.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,6 +2672,10 @@ def test_publisher_transport_channel_mtls_with_client_cert_source(transport_clas
26722672
),
26732673
ssl_credentials=mock_ssl_cred,
26742674
quota_project_id=None,
2675+
options=[
2676+
("grpc.max_send_message_length", -1),
2677+
("grpc.max_receive_message_length", -1),
2678+
],
26752679
)
26762680
assert transport.grpc_channel == mock_grpc_channel
26772681
assert transport._ssl_channel_credentials == mock_ssl_cred
@@ -2713,6 +2717,10 @@ def test_publisher_transport_channel_mtls_with_adc(transport_class):
27132717
),
27142718
ssl_credentials=mock_ssl_cred,
27152719
quota_project_id=None,
2720+
options=[
2721+
("grpc.max_send_message_length", -1),
2722+
("grpc.max_receive_message_length", -1),
2723+
],
27162724
)
27172725
assert transport.grpc_channel == mock_grpc_channel
27182726

0 commit comments

Comments
 (0)