title: How to decrease the timeout in Jakarta EE 9.1 CDI Conversation Scope (MyFaces 3.0)
body: <p>this is Fernando,</p>
  <p>I am using JSF 3.0 and and Conversation Scope in some Managed Beans. The problem I am facing is to configure the timeout to expire abandoned conversations. The default 30 minutes is too long to my context and I need to set this around 10 minutes. I have tried to set the timeout using the conversation.setTimeout(10000) method, but, even having the TomEE showing that the correct timeout has been settled, through the conversation.getTimeout(), it keeps expiring the conversation, and consequently destroying the managed beans, only after 30 minutes.
  The second approach that I have tried is to create openwebbeans.properties file inside the META-INF/openwebbeans directory and putting theese keys:</p>
  <pre><code>configuration.ordinal=101
  org.apache.webbeans.conversation.Conversation.timeoutInterval=10000
  </code></pre>
  <p>Again the results are the same. TomEE shows the correct timeout through the conversation.getTimeout() method, but keeps expiring the conversation only after 30 minutes.</p>
  <p>Following is the code that I have used to test the situation:</p>
  <pre><code>
  package estudosjsf;
  
  import java.io.Serializable;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  
  import jakarta.annotation.PostConstruct;
  import jakarta.annotation.PreDestroy;
  import jakarta.enterprise.context.Conversation;
  import jakarta.enterprise.context.ConversationScoped;
  import jakarta.inject.Inject;
  import jakarta.inject.Named;
  
  @Named
  @ConversationScoped
  public class Controller implements Serializable {
  
      private static final long serialVersionUID = 1L;
      
      private String text = &quot;This is a simple text&quot;;
  
      @Inject
      private Conversation conversation;
  
      @PostConstruct
      public void create() {
          System.out.println(&quot;Created at &quot; + new SimpleDateFormat(&quot;HH:mm:ss&quot;).format(new Date()));
      }
  
      @PreDestroy
      public void destroy() {
          System.out.println(&quot;Destroyed at &quot; + new SimpleDateFormat(&quot;HH:mm:ss&quot;).format(new Date()));
      }
  
      public void begin() {
          conversation.begin();
          conversation.setTimeout(10000);
          System.out.println(conversation.getTimeout());
      }
  
      public void end() {
          conversation.end();
      }
  
      public String getText() {
          return text;
      }
  
      public void setText(String text) {
          this.text = text;
      }
  
  }
  
  </code></pre>
  <p>And:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
  
  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:h=&quot;http://xmlns.jcp.org/jsf/html&quot;&gt;
      &lt;h:form&gt;
          Message:
          &lt;br&gt;&lt;/br&gt;
          &lt;br&gt;&lt;/br&gt; 
          &lt;h:inputText value=&quot;#{controller.text}&quot;/&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;h:commandButton value=&quot;Begin&quot; actionListener=&quot;#{controller.begin()}&quot; /&gt; 
          &lt;br&gt;&lt;/br&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;h:commandButton value=&quot;End&quot; actionListener=&quot;#{controller.end()}&quot; /&gt;
      &lt;/h:form&gt;
  &lt;/html&gt;
  
  </code></pre>
  <p>I really appreciate any help!</p>
  <p>Thanks!</p>