test:
  hostport: httpbin.org:80
  uri: lb://testservice

my.timeout: 3000

server:
  error:
    include-message: always

spring:
  profiles:
    group:
      - logging

  cloud:
    gateway:
      routes:
        # =====================================
        - id: per_route_connect_timeout
          uri: http://localhost:32167
          predicates:
            - name: Path
              args:
                pattern: /connect/delay/{timeout}
          metadata:
            connect-timeout: 5

        # =====================================
        - id: per_route_response_timeout
          uri: ${test.uri}
          predicates:
            - name: Path
              args:
                pattern: /route/delay/{timeout}
          filters:
            - StripPrefix=1
          metadata:
            response-timeout: 1000

        # =====================================
        - id: per_route_response_timeout_disabled
          uri: ${test.uri}
          predicates:
            - name: Path
              args:
                pattern: /disabledRoute/delay/{timeout}
          filters:
            - StripPrefix=1
          metadata:
            response-timeout: -1

        # =====================================
        - id: per_route_response_timeout_invalid
          uri: ${test.uri}
          predicates:
            - name: Path
              args:
                pattern: /invalidRoute/delay/{timeout}
          filters:
            - StripPrefix=1
          metadata:
            response-timeout: notANumber

        # =====================================
        - id: per_route_merge_response_headers
          uri: ${test.uri}
          predicates:
            - Host=**.mergeresponseheader.org
            - Path=/responseheaders/**
          filters:
            - AddResponseHeader=X-Test-SHOULD-MERGED-HEADER, value-from-gateway
          metadata:
            response-timeout: 1000

        # =====================================
        - id: per_route_response_timeout_placeholder
          uri: ${test.uri}
          predicates:
            - Host=**.responsetimeoutplaceholder.org
            - Path=/responseheaders/**
          metadata:
            response-timeout: ${my.timeout}

        # =====================================
        # should be last and not follow alphabetical order
        - id: default_path_to_httpbin
          uri: ${test.uri}
          order: 10000
          predicates:
            - name: Path
              args:
                pattern: /**
      httpclient:
        response-timeout: 3s
