java spring启动应用程序后很少请求502坏网关

llmtgqce  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(130)

我的java spring启动应用程序有问题,
应用程序功能:这是一个简单的http post uri应用程序,即,我的应用程序将对uri执行http post调用,并获取信息(json)并发送回信息,并且从我的api中,uri的json主体将发送到服务。
问题:所以对于最初的几个请求,没有问题,我将能够在没有任何错误的情况下得到响应,在几次点击之后,比如在30多个请求之后,我有502个坏网关。我使用的是spring boot提供的tomcat默认服务器。仅供参考,源uri工作正常。源uri没有问题。
响应时间为300ms-90ms
尝试的解决方案:从java.net.http更改为org.apache.http
我在网上读到tomcat有一个限制,所以我甚至在jboss eap和javax.servlet.api中部署了这个应用程序,但错误还在继续。
我已关闭httpclient和closeablehttpresponse,但错误仍在继续。
使用的依赖项:

<dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.13</version>
        </dependency>
         <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题