Class GatewayService
Implementation of the gRPC Gateway service. Provides service discovery and method invocation. Event subscription (Gateway.Subscribe) was never added to gateway.proto -- Pubsub.Subscribe (see PubsubService) is the only subscribe path; this class previously held unused constructor dependencies (DaprPublishSubscribeClient, TopicDaprSubscriptionRegistry, GatewaySubscriptionManager) left over from that never-implemented design.
public class GatewayService : Gateway.GatewayBase
- Inheritance
-
Gateway.GatewayBaseGatewayService
- Inherited Members
Constructors
GatewayService(GrpcReflectionService, ServicesConfiguration, ILogger<GatewayService>, DaprResiliencePipeline)
Creates a new GatewayService instance.
public GatewayService(GrpcReflectionService reflectionService, ServicesConfiguration config, ILogger<GatewayService> logger, DaprResiliencePipeline resilience)
Parameters
reflectionServiceGrpcReflectionServiceThe gRPC reflection service for method discovery.
configServicesConfigurationThe services configuration containing registered services.
loggerILogger<GatewayService>The logger for recording service events.
resilienceDaprResiliencePipelineThe Dapr resilience pipeline for wrapping gateway invocations.
Methods
GetMethodSchema(GetMethodSchemaRequest, ServerCallContext)
Gets the schema for a specific method including input/output types and field definitions.
public override Task<GetMethodSchemaResponse> GetMethodSchema(GetMethodSchemaRequest request, ServerCallContext context)
Parameters
requestGetMethodSchemaRequestThe get method schema request containing service, method, and schema type.
contextServerCallContextThe server call context.
Returns
- Task<GetMethodSchemaResponse>
The method schema including field definitions.
Invoke(InvokeRequest, ServerCallContext)
Invokes a method on a backend service using raw protobuf bytes.
public override Task<InvokeResponse> Invoke(InvokeRequest request, ServerCallContext context)
Parameters
requestInvokeRequestThe invoke request containing service name, method name, and request data.
contextServerCallContextThe server call context.
Returns
- Task<InvokeResponse>
The invoke response containing success status and response data.
InvokeJson(InvokeJsonRequest, ServerCallContext)
Invokes a method on a backend service using JSON request/response data. This is the recommended method for most use cases.
public override Task<InvokeJsonResponse> InvokeJson(InvokeJsonRequest request, ServerCallContext context)
Parameters
requestInvokeJsonRequestThe invoke JSON request containing service name, method name, and JSON request data.
contextServerCallContextThe server call context.
Returns
- Task<InvokeJsonResponse>
The invoke JSON response containing success status and JSON response data.
ListMethods(ListMethodsRequest, ServerCallContext)
Lists all methods available for a specific service.
public override Task<ListMethodsResponse> ListMethods(ListMethodsRequest request, ServerCallContext context)
Parameters
requestListMethodsRequestThe list methods request containing the service name.
contextServerCallContextThe server call context.
Returns
- Task<ListMethodsResponse>
A list of method descriptors.
ListServices(ListServicesRequest, ServerCallContext)
Lists all services registered with the gateway.
public override Task<ListServicesResponse> ListServices(ListServicesRequest request, ServerCallContext context)
Parameters
requestListServicesRequestThe list services request.
contextServerCallContextThe server call context.
Returns
- Task<ListServicesResponse>
A list of service names.