CloseableHttpClient在OpenShift tomcat的荚

问题描述:

这里返回504的问题是:CloseableHttpClient在OpenShift tomcat的荚

我们有一个向前的代理支柱的Web应用程序。所有请求都转发到另一个mvc应用程序,并且重定向到转发代理/ struts应用程序的响应。目前,它已部署在iPlanet和rhel服务器上。

我们正在将(或试图)将struts应用程序移至OpenShift和Tomcat。该应用程序在生产,开发和uat环境以及开发机器上运行良好。在tomcat和jboss上。

我的问题是以下几点:我们的一个struts动作会影响前向代理。

      <action name="prepare" 

              class="com.authentication.action.ProxyAction"> 

              <result name="success" type="proxy"> 

                  <param name="location">${path}</param> 

                  <param name="parse">true</param> 

              <param name="encode">false</param> 

              </result> 

              <result name="error" type="tiles">login</result> 

          </action> 

CloseableHttpClient代码的代码如下。

      CloseableHttpClient client = HttpClients.custom() 

                  .setSSLContext(sslContext) 

                  .setDefaultCookieStore(cookieStore) 

                  .setDefaultRequestConfig(config) 

                  .setSSLHostnameVerifier(new NoopHostnameVerifier()) 

                  .setRedirectStrategy(new LaxRedirectStrategy()) 

                  .setDefaultHeaders(headers) 

                  .build(); 

在OpenShift pod上发生了什么,并且只在OpenShift上发生了504错误。

mvc应用程序正在接收来自struts的所有请求并将其返回。 curl在pod控制台上也返回值,所以我丢弃了网络问题。

我不知道接下来该做什么,有没有人遇到过这种问题?

谢谢

这个问题根本不在CloseableHttpClient上。

要挂载当前的url,我们使用request.getServerName(),这对PaaS解决方案没有任何意义,因为您有OpenShift pod和一个Route到您的系统。这个URL然后被用作CloseableHttpClient的参数,这就是为什么我们得到了504,URL并不在第一位。