Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents dbb0c0b + 521ee73 commit bd7071d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Momento.Sdk/Internal/AuthGrpcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public AuthGrpcManager(IAuthConfiguration config, string authToken, string endpo
}

channelOptions.Credentials = ChannelCredentials.SecureSsl;
channelOptions.MaxReceiveMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE;
channelOptions.MaxSendMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE;

#if USE_GRPC_WEB
channelOptions.HttpHandler = new GrpcWebHandler(new HttpClientHandler());
#endif
Expand Down
4 changes: 3 additions & 1 deletion src/Momento.Sdk/Internal/ControlGrpcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ public ControlGrpcManager(ILoggerFactory loggerFactory, string authToken, string
this.channel = GrpcChannel.ForAddress(uri, new GrpcChannelOptions()
{
Credentials = ChannelCredentials.SecureSsl,
MaxReceiveMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE,
MaxSendMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE,
#if USE_GRPC_WEB
HttpHandler = new GrpcWebHandler(new HttpClientHandler())
HttpHandler = new GrpcWebHandler(new HttpClientHandler()),
#endif
});
List<Header> headers = new List<Header> { new Header(name: Header.AuthorizationKey, value: authToken), new Header(name: Header.AgentKey, value: version), new Header(name: Header.RuntimeVersionKey, value: runtimeVersion) };
Expand Down
3 changes: 3 additions & 0 deletions src/Momento.Sdk/Internal/DataGrpcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ internal DataGrpcManager(IConfiguration config, string authToken, string endpoin
channelOptions.LoggerFactory = config.LoggerFactory;
}
channelOptions.Credentials = ChannelCredentials.SecureSsl;
channelOptions.MaxReceiveMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE;
channelOptions.MaxSendMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE;

#if USE_GRPC_WEB
channelOptions.HttpHandler = new GrpcWebHandler(new HttpClientHandler());
#endif
Expand Down
3 changes: 3 additions & 0 deletions src/Momento.Sdk/Internal/TopicGrpcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ internal TopicGrpcManager(ITopicConfiguration config, string authToken, string e
}

channelOptions.Credentials = ChannelCredentials.SecureSsl;
channelOptions.MaxReceiveMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE;
channelOptions.MaxSendMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE;

#if USE_GRPC_WEB
channelOptions.HttpHandler = new GrpcWebHandler(new HttpClientHandler());
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/Momento.Sdk/Internal/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ namespace Momento.Sdk.Internal;
/// </summary>
public static class Utils
{
/// <summary>
/// The default value for max_send_message_length is 4mb. We need to increase this to 5mb in order to support cases where users have requested a limit increase up to our maximum item size of 5mb.
/// </summary>
public const int DEFAULT_MAX_MESSAGE_SIZE = 5_243_000;

/// <summary>
/// Convert a UTF-8 encoded string to a byte array.
/// </summary>
Expand Down
4 changes: 3 additions & 1 deletion src/Momento.Sdk/Internal/VectorIndexControlGrpcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ internal VectorIndexControlGrpcManager(ILoggerFactory loggerFactory, string auth
var channelOptions = new GrpcChannelOptions
{
LoggerFactory = loggerFactory,
Credentials = ChannelCredentials.SecureSsl
Credentials = ChannelCredentials.SecureSsl,
MaxReceiveMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE,
MaxSendMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE,
};
#if USE_GRPC_WEB
channelOptions.HttpHandler = new GrpcWebHandler(new HttpClientHandler());
Expand Down
3 changes: 3 additions & 0 deletions src/Momento.Sdk/Internal/VectorIndexDataGrpcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ internal VectorIndexDataGrpcManager(IVectorIndexConfiguration config, string aut
var channelOptions = config.TransportStrategy.GrpcConfig.GrpcChannelOptions;
channelOptions.LoggerFactory ??= config.LoggerFactory;
channelOptions.Credentials = ChannelCredentials.SecureSsl;
channelOptions.MaxReceiveMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE;
channelOptions.MaxSendMessageSize = Internal.Utils.DEFAULT_MAX_MESSAGE_SIZE;

#if USE_GRPC_WEB
channelOptions.HttpHandler = new GrpcWebHandler(new HttpClientHandler());
#endif
Expand Down

0 comments on commit bd7071d

Please sign in to comment.