Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
126 views
in Technique[技术] by (71.8m points)

Increase Spring Cloud Gateway RequestBodySize

I'm currently getting a 413 Request Entity Too Large when posting something routing through a Spring Cloud Gateway. It works when the request body isn't larger than around 3MB.

Here is my application.yml (Scrubbed)

spring:
  profiles:
    active: prod
  main:
    allow-bean-definition-overriding: true
  application:
    name: my-awesome-gateway
  cloud:
    gateway:
      default-filters:
        - DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_UNIQUE
      routes:
        - id: my-service
          uri: https://myservicesdomainname
          predicates:
            - Path=/service/**
          filters:
            - StripPrefix=1
            - UserInfoFilter
            - name: Hystrix
              args:
                name: fallbackCommand
                fallbackUri: forward:/fallback/first
            - name: RequestSize
              args:
                maxSize: 500000000 #***** Here is my attempt to increase the size
      httpclient:
        connect-timeout: 10000
        response-timeout: 20000

This is the link I got RequestSize/args/maxSize from

https://cloud.spring.io/spring-cloud-static/spring-cloud-gateway/2.1.0.RELEASE/multi/multi__gatewayfilter_factories.html#_requestsize_gatewayfilter_factory

Edit: The issue was with a Kubernetes Ingress Controller. I fixed the issue there and it's now working

question from:https://stackoverflow.com/questions/65910046/increase-spring-cloud-gateway-requestbodysize

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...