Api Gateway service configuration

Hi, In advance I apologize if a question silly…
I have several independent web services that work separately, and now I need to make аpi gateway so that there is a single entry point.
I read the documentation but did not find any examples of use.

Suppose we have a service X.
As I understood, add the external service with the following:

public override void Configure(Container container)
{
    container.Register<IServiceGateway>(c => new JsonServiceClient(XServiceUrl));
}

The question is

  1. could I automatically generate a Request DTO?
  2. are there any tools for this?
  3. do I need to repeat the Request DTO descriptions in Api Gateway?

Thanks.

This registration:

container.Register<IServiceGateway>(c => new JsonServiceClient(XServiceUrl));

As the Service Gateway docs states:

redirect all Service Gateway calls to a remote ServiceStack instance

Which means each call using base.Gateway.Send(requestDto) will be sent to your ServiceStack instance at XServiceUrl

You’d use the same Request DTO as you would any other ServiceStack Service, e.g. you could share your Services ServiceModel.dll, use the C# Add ServiceStack Reference to generate the Request DTO’s you need or just copy/paste your Request DTO classes if you don’t want to share your ServiceModel.dll.

1 Like

Hmm … I understand …
From the variants I prefer a copy-paste.
We have several internal services that work in dockers on k8s, it is necessary to realize access to these services through one point…
It turns out that all correctly worked it is necessary after each change of a separate service it is necessary to change and a gateway service too to always receive the actual api.

Thank you very much Demis!