<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>What would cause a timeout to an external API at exactly 120 seconds</title>
  <link rel="self" href="https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121408855" />
  <subtitle>What would cause a timeout to an external API at exactly 120 seconds</subtitle>
  <id>https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121408855</id>
  <updated>2026-08-02T06:52:14Z</updated>
  <dc:date>2026-08-02T06:52:14Z</dc:date>
  <entry>
    <title>RE: What would cause a timeout to an external API at exactly 120 seconds</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121410451" />
    <author>
      <name>Pete Helgren</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121410451</id>
    <updated>2022-04-26T21:34:52Z</updated>
    <published>2022-04-26T21:34:36Z</published>
    <summary type="html">&lt;p&gt;Again, thanks.&lt;br /&gt;
  &lt;br /&gt; More digging... turns out the one difference between the
  development and production system is that the production instance is
  front-ended by Apache and the Apache instance is a reverse proxy with
  a value of &amp;quot;ProxyPass / http://XXX.XXX.XXX.XXX:7080/ timeout=120
  retry=0&amp;quot;  Exactly two minutes.&lt;br /&gt;
  &lt;br /&gt; So, it was a configuration setting...but in Apache HTTP rather
  than Liferay.&lt;br /&gt;
  &lt;br /&gt; Thanks for all the suggestions.&lt;/p&gt;</summary>
    <dc:creator>Pete Helgren</dc:creator>
    <dc:date>2022-04-26T21:34:36Z</dc:date>
  </entry>
  <entry>
    <title>RE: What would cause a timeout to an external API at exactly 120 seconds</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121409788" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121409788</id>
    <updated>2022-04-26T13:31:51Z</updated>
    <published>2022-04-26T13:29:35Z</published>
    <summary type="html">&lt;p&gt;Take a look also to the method &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/net/URLConnection.html#setReadTimeout-int-"&gt;&lt;strong&gt;setReadTimeout &lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-04-26T13:29:35Z</dc:date>
  </entry>
  <entry>
    <title>RE: What would cause a timeout to an external API at exactly 120 seconds</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121409672" />
    <author>
      <name>Pete Helgren</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121409672</id>
    <updated>2022-04-26T12:37:47Z</updated>
    <published>2022-04-26T12:37:46Z</published>
    <summary type="html">&lt;p&gt;Thanks Gennaro.  I have seen that suggestion in other forums.  What I
  don't understand is why it would work, without setting that value, in
  a development environment but would be needed in production..  I would
  understand that change if it timed out at 120 seconds in both the
  development and production environments since the same module/portlet
  would be deployed in both.&lt;br /&gt;
  &lt;br /&gt; ​​​​​​​But, perhaps it will override any other setting so I'll
  give it a try.  Thanks for the suggestion.&lt;br /&gt;
  &lt;br /&gt; ​​​​​​​Pete&lt;/p&gt;</summary>
    <dc:creator>Pete Helgren</dc:creator>
    <dc:date>2022-04-26T12:37:46Z</dc:date>
  </entry>
  <entry>
    <title>RE: What would cause a timeout to an external API at exactly 120 seconds</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121409503" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121409503</id>
    <updated>2022-04-26T09:56:22Z</updated>
    <published>2022-04-26T09:56:20Z</published>
    <summary type="html">&lt;pre&gt;
&lt;code class="language-java"&gt;HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection();
con.setConnectTimeout(your_time);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Just set the timeout to &amp;quot;your_time&amp;quot; milliseconds&lt;/p&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-04-26T09:56:20Z</dc:date>
  </entry>
  <entry>
    <title>What would cause a timeout to an external API at exactly 120 seconds</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121408854" />
    <author>
      <name>Pete Helgren</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121408854</id>
    <updated>2022-04-25T15:52:20Z</updated>
    <published>2022-04-25T15:52:18Z</published>
    <summary type="html">&lt;p&gt;I have a portlet that makes a call to a long running API.  What is
  interesting is that I have a development environment that does not
  time out yet the production environment will time out (actually with
  an HTTP 502 error) at exactly 120 seconds.  I don't belive that there
  is any issue at the remote since it will successfully run in
  development.  Both the production and development environment use the
  same outbound routing and gateway.&lt;br /&gt;
  &lt;br /&gt; The only notable difference is that the production environment
  is Linux (CENTOS) and the development environment is Windows 10. 
  Otherwise the Liferay version is the same: 7.3.2-ga3 and the module
  deplyed is the same.  I checked the server.xml,
  context.xml, portal-ext.properties and they are the same.  I suspect
  that I made a change to a variable *somewhere* but I cannot find any
  difference in either environment that would point to a change.&lt;br /&gt;
  &lt;br /&gt; FWIW the API is accessed via a REST call using HttpsURLConnection.&lt;br /&gt;
  &lt;br /&gt; Can you think of a setting in Liferay that might affect a
  timeout for an external API call?  I haven't been able to find
  anything.&lt;br /&gt;  &lt;/p&gt;</summary>
    <dc:creator>Pete Helgren</dc:creator>
    <dc:date>2022-04-25T15:52:18Z</dc:date>
  </entry>
</feed>
