8using System.Threading.Tasks;
29 : base(applicationContext)
35 private GrpcChannel _channel;
36 private static GrpcChannel _defaultChannel;
47 _channel = _defaultChannel;
58 _defaultChannel = channel;
61 private GrpcService.GrpcServiceClient _grpcClient;
69 return _grpcClient ??=
new GrpcService.GrpcServiceClient(
GetChannel());
81 protected override async Task<byte[]>
CallDataPortalServer(
byte[] serialized,
string operation,
string routingToken,
bool isSync)
83 ByteString outbound = ByteString.CopyFrom(serialized);
84 var request =
new RequestMessage
89 ResponseMessage response;
94 return response.Body.ToByteArray();
97 internal async Task<ResponseMessage> RouteMessage(RequestMessage request)
102 private string CreateOperationTag(
string operatation,
string versionToken,
string routingToken)
104 if (!
string.IsNullOrWhiteSpace(versionToken) || !
string.IsNullOrWhiteSpace(routingToken))
105 return $
"{operatation}/{routingToken}-{versionToken}";
Provides consistent context information between the client and server DataPortal objects.
static string VersionRoutingTag
Gets a value representing the application version for use in server-side data portal routing.
Implements a data portal proxy to relay data portal calls to a remote application server by using gRP...
override async Task< byte[]> CallDataPortalServer(byte[] serialized, string operation, string routingToken, bool isSync)
Create message and send to Grpc server.
virtual GrpcChannel GetChannel()
Gets the GrpcChannel used by the gRPC client.
static void SetChannel(GrpcChannel channel)
Sets the GrpcChannel used by gRPC clients.
virtual GrpcService.GrpcServiceClient GetGrpcClient()
Get gRPC client object used by data portal.
GrpcProxy(ApplicationContext applicationContext, GrpcChannel channel, GrpcProxyOptions options)
Creates an instance of the object, initializing it to use the supplied GrpcChannel object and URL.
string DataPortalUrl
Data portal server endpoint URL
Implements a data portal proxy to relay data portal calls to a remote application server.
string DataPortalUrl
Gets the URL address for the data portal server used by this proxy instance.