Class LambdaRouterMiddleware

java.lang.Object
com.networknt.aws.lambda.handler.middleware.router.LambdaRouterMiddleware
All Implemented Interfaces:
LambdaHandler, MiddlewareHandler

public class LambdaRouterMiddleware extends Object implements MiddlewareHandler
This middleware is responsible for routing the incoming request to the external microservices.
  • Field Details

    • FAILED_TO_INVOKE_SERVICE

      public static final String FAILED_TO_INVOKE_SERVICE
      See Also:
    • EXCHANGE_HAS_FAILED_STATE

      public static final String EXCHANGE_HAS_FAILED_STATE
      See Also:
    • CONFIG

      public static final com.networknt.router.RouterConfig CONFIG
  • Constructor Details

    • LambdaRouterMiddleware

      public LambdaRouterMiddleware()
  • Method Details

    • execute

      public com.networknt.status.Status execute(LightLambdaExchange exchange)
      Specified by:
      execute in interface LambdaHandler
    • createRouterRequestPath

      public String createRouterRequestPath(List<com.networknt.handler.config.UrlRewriteRule> urlRewriteRules, String requestPath)
      Builds a complete request path string for our router request.
      Parameters:
      urlRewriteRules - - the list of url rewrite rules
      requestPath - - the original request path
      Returns:
      - targetRequestPath the target request path string
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: LambdaHandler
      Indicate if this handler is enabled or not.
      Specified by:
      isEnabled in interface LambdaHandler
      Returns:
      boolean true if enabled
    • register

      public void register()
      Description copied from interface: LambdaHandler
      Register this handler to the handler registration.
      Specified by:
      register in interface LambdaHandler
    • reload

      public void reload()
      Description copied from interface: LambdaHandler
      Reload config values in case the config values changed by config server.
      Specified by:
      reload in interface LambdaHandler
    • isContinueOnFailure

      public boolean isContinueOnFailure()
      Description copied from interface: MiddlewareHandler
      Indicate if this middleware handler will continue on failure or not.
      Specified by:
      isContinueOnFailure in interface MiddlewareHandler
      Returns:
      boolean true if continue on failure
    • isAudited

      public boolean isAudited()
      Description copied from interface: MiddlewareHandler
      Indicate if this middleware handler is audited or not.
      Specified by:
      isAudited in interface MiddlewareHandler
      Returns:
      boolean true if audited
    • isAsynchronous

      public boolean isAsynchronous()
      Description copied from interface: LambdaHandler
      Indicate if this middleware handler is asynchronous or not.
      Specified by:
      isAsynchronous in interface LambdaHandler
      Returns:
      boolean true if asynchronous
    • getCachedConfigurations

      public void getCachedConfigurations()
      Specified by:
      getCachedConfigurations in interface MiddlewareHandler