3 Replies Latest reply on Mar 15, 2012 1:47 AM by jaikiran

    EJB SLSB remote-invocation timeout configuration

    sumitsu

      In previous versions of the JBoss AS, it was possible to configure EJB 3.x stateless session beans to apply a default read timeout value to the invoker proxy, such that EJB remote invocations would timeout on the client side if the EJB server-side logic failed to return a response within a configured number of milliseconds.  Here is how it worked in JBoss AS 4.2.x:

       

      https://community.jboss.org/message/410925#410925

       

      (The procedure is similar for JBoss AS 6.x, except that the configuration file to be modified is server/CONF/deploy/ejb3-connectors-jboss-beans.xml.)

       

      I have been unable to find an equivalent configuration under JBoss AS 7.  I tried to set a default-access-timeout attribute under session-bean/stateless under the ejb3 subsystem (similar to the attribute of the same name for SFSBs and singletons):

       

       

      <subsystem xmlns="urn:jboss:domain:ejb3:1.2">

          <session-bean>

              <stateless default-access-timeout="5000">

                  <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>

              </stateless>

       

       

      JBoss refuses to start when I do so, complaining that the configuration doesn't validate:

       

       

      10:41:19,159 ERROR [org.jboss.as.controller] JBAS014601: Error booting the container: java.lang.RuntimeException: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration

      ...

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[121,17]

      Message: JBAS014788: Unexpected attribute 'default-access-timeout' encountered

       

       

      Is there any way to set this timeout for EJBs deployed to JBoss AS 7.1.x, and invoked through JNDI (via these procedures)?  Either a server-side or a client-side configuration would work for my use case.

       

      Thanks!

        • 1. Re: EJB SLSB remote-invocation timeout configuration
          jaikiran

          The default-access-timeout is not meant for what you are trying to achieve. That configuration is the default value to be used in the absence of any @javax.ejb.AccessTimeout for stateful beans.

           

          As for the invocation timeout for remote invocations - it's a feature request here https://issues.jboss.org/browse/AS7-3811

          1 of 1 people found this helpful
          • 2. Re: EJB SLSB remote-invocation timeout configuration
            sumitsu

            Thanks, Jaikiran.  Do you have any expectation as to when (or which JBoss AS version) that feature might be available?

             

            Since I see that there is some debate as to the necessity of this feature on the JIRA page, I'd like to weigh in that in our environment, it is absolutely crucial that it be possible to cap the amount of time a client might wait for an EJB invocation to complete.  In theory, certainly, it would be preferable to resolve the root problem causing the server-side logic to stall, but in the event of an unanticipated failure causing said logic to stall out, the timeout is imperative as a fail-safe to prevent the hanging failure from cascading back to the client application/system.  It is much more doable, on the client side, to build logic to handle failures due to timeouts than it is to build logic to recover from a synchronous invocation which never terminates at all.

             

            Thanks again.

            • 3. Re: EJB SLSB remote-invocation timeout configuration
              jaikiran

              Branden Smith wrote:

               

              Thanks, Jaikiran.  Do you have any expectation as to when (or which JBoss AS version) that feature might be available?

               

              There are a couple of possible ways that have been mentioned in terms of how this is implemented. But apart from the implementation details, I think this should be available in the next release of AS7. Infact, you most likely won't even need to wait for the AS7 release and might just use the new EJB client API release containing this fix, if we end up fixing this without any server interaction (one of the suggested approaches for the timeout is to ping the server to check for the invocation status).