Microgateway Configuration

Introduction

This article explains how to configure Microgateways. Microgateway configuration explains different configuration details available in Microgateway.

Audience

It is assumed that readers of this article are familiar with usage of API Gateway and concepts of Microgateway.

Pre-Requisites

  • Start API Gateway
  • Configure few APIs

Use Case

The common usage of microservices and architectures based on microservices has increased the need for light weight gateways. The flexible deployment nature of Microgateway makes it ideal for low latency small footprint solutions.

Microgateway enables microservices to communicate with each other directly without the need for API Gateway. This eases the traffic overload on API Gateway and reduces the latency in the communication round trip. The required protection policies can be enforced on the Microgateway to establish a secure communication channel between the microservices.

Configuring Microgateways

Microgateways can be started using the system-settings.yml, the default settings file or the user defined custom-settings.yml file.

system-settings.yml file is in <<Installation Folder>>\Microgateway\config.

The system-settings.yml file has the below sections,

  • faults: contains variables for error handling such as default error message and native provider fault
  • extended_settings: contains list of extended settings that can be used in microgateway
  • gateway_destination: list of API Gateway settings for logging in API Gateway
  • key_store: Keystore settings for establishing HTTPS connections
  • trust_store: Truststore settings for HTTPS handshake for specific policies
  • system: internal settings

Any changes to the configuration must be added in custom-settings.yml and this value overrides system-settings.yml.

Example: custom-settings.yml

ports:
   http: "8054"
   https: "8053" 
api_gateway:
   url: "host:port"
   user: "Administrator"
   password: "password"
microgatewayPool:
    microgatewayPoolName: "DemoPool"
    microgatewayPoolDescription: "This is a Demo Pool"
archive:
   file: "apigw-archive.zip"

Assets Details

APIs, API scopes, Policies, aliases, and applications can be configured using custom-settings.yml.

Example: custom-settings.yml

aliases:
  petstore_host: 
    type: simple
    value: petstore.swagger.iov2
 
 petstore_endpoint:
    type: endpoint
    endPointURI: http://petstore.swagger.io/v2/pet/4
    connectionTimeout: 30
    readTimeout: 30
    suspendDurationOnFailure: 0
    optimizationTechnique: None
    passSecurityHeaders: false
    keystoreAlias: ''

 BasicAuth_Custom:
    type: httpTransportSecurityAlias
    authType: HTTP_BASIC
    authMode: INCOMING_HTTP_BASIC_AUTH
    httpAuthCredentials:
      userName: Administrator123
      password: manage
      domain: null

Command to create individual settings file

  1. Command to create yml file by downloading all settings from API Gateway

microgateway.bat downloadSettings -gw http://localhost:port/rest/apigateway -gwu Administrator -gwp password --output my-custom-settings.yml

  1. Command to merge custom settings with API Gateway settings in a yml file

./microgateway.sh downloadSettings -gw http://localhost:port/rest/apigateway -gwu Administrator -gwp password --config my-config.yml --output config/my-custom-config.yml

1 Like