4 Replies Latest reply on Jan 22, 2014 2:13 AM by wdfink

    jboss as 7 slsb timeout for a request

    rameshchokkapu

      Hi Good Evening..!!

       

      We have recently migrated to Jboss 4 to jboss 7.

       

      We will get  lakhs of requests to my jboss server.

      we are processing each request  max response time below 2 seconds.

      but some of request are taking long time, means more than 5 minutes.

      we want to exit from these long time requests.

      please help me.

      which timeout is better.

      1) EJB  or  2) Http .

       

      How to configure timeout for  EJB ????

      How to configure timeout for  Http ????

        • 1. Re: jboss as 7 slsb timeout for a request
          erasmomarciano

          Do you have Apache ad front-end?

          • 2. Re: jboss as 7 slsb timeout for a request
            wdfink

            For EJB's you might set the invocation.timeout property which is millis, the invocation will interrupted with a java.util.concurrent.TimeoutException.

            But remember that only the invocation is interrupted, the server side will continue. You might need to ensure with a Tx timeout that the transaction does not commit.

            • 3. Re: jboss as 7 slsb timeout for a request
              rameshchokkapu

              Thank you for Reply..

               

              we are not using  Apache  front-end .

               

              Please kindly suggest me, Its become as urgent.

               

              We are using stateless session beans.

              where should i configure in standalone.xml.

              how i can go through with Annotations.

               

               

              We are not using any ejb-client.

               

               

              My clients will post request to servlet,  From that servlet, we will call ejb method.

              we are using ejb3.

               

               

              Servelt :

               

               

              public class MySerlvet extends HttpServlet {

                  @EJB

                  MyEJBBean myEJBBean;

                protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {

                        String RS = myEJBBean.processEjbMethod(rqstring);

                }

              }

               

               

              EJB :

               

               

              @Stateless

              @LocalBean

              @TransactionManagement(javax.ejb.TransactionManagementType.BEAN)

              public class MyEJBBean {

                   public String processEjbMethod(String rqstring) {

                              --------------------

                             -----------------------

                         return rs;

                    }

              }

               

               

              Please kindly suggest me..

              • 4. Re: jboss as 7 slsb timeout for a request
                wdfink

                There is no timeout at server side for this, neither standalone.xml nor annotation.

                The only way to control it is the ejb-client side where you can set the timeout property as I explained.

                 

                If you use the eib invocation local, i.e. from JSF you can not set a timeout for the ejb.

                A possible solution might be a @Asynchronous EJB invocation