5 Replies Latest reply on May 15, 2013 11:51 PM by james viet

    Retry Interceptor in AS7?

    ashvish Newbie

      Hi All,

       

      We had the  <invoker-proxy-bindings> specified in JBoss.xml for our clustered EJB's in Jboss 4. Is there something similar in AS 7.1? If so where this need to be specified? A sample of the existing Jboss.xml inside ejb jar is given below;

       

      <jboss>

          <enterprise-beans>

            <session>

              <ejb-name>SomeEJBName</ejb-name>

                       <invoker-bindings>

                                 <invoker>

                                    <invoker-proxy-binding-name>clustered-retry-stateless-rmi-invoker</invoker-proxy-binding-name>

                                    <jndi-name>SomeBeanJNDI</jndi-name>

                                 </invoker>

                              </invoker-bindings>

               <configuration-name>Clustered Stateless SessionBean</configuration-name>

               <clustered>true</clustered>

          </session>

          </enterprise-beans>

              <invoker-proxy-bindings>

            <invoker-proxy-binding>

               <name>clustered-retry-stateless-rmi-invoker</name>

               <invoker-mbean>jboss:service=invoker,type=jrmpha</invoker-mbean>

               <proxy-factory>org.jboss.proxy.ejb.ProxyFactoryHA</proxy-factory>

               <proxy-factory-config>

                  <client-interceptors>

                     <home>

                        <interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor>

                        <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                        <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                        <interceptor>org.jboss.proxy.ejb.RetryInterceptor</interceptor>

                        <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>

                     </home>

                     <bean>

                        <interceptor>org.jboss.proxy.ejb.StatelessSessionInterceptor</interceptor>

                        <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                        <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                        <interceptor>org.jboss.proxy.ejb.RetryInterceptor</interceptor>

                        <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>

                     </bean>

                  </client-interceptors>

               </proxy-factory-config>

            </invoker-proxy-binding>

            </invoker-proxy-bindings>

      </jboss>

        • 1. Re: Retry Interceptor in AS7?
          james viet Newbie

          hi Ashvish,

           

          Do you find solution for this? I'm doing on this but havent find another way yet.

          • 2. Re: Retry Interceptor in AS7?
            ashvish Newbie

            No I haven't, I doubt if there is a retry interceptor in Jboss 7. However please let me know if you find a solution.

            • 3. Re: Retry Interceptor in AS7?
              james viet Newbie

              How about EJB interceptors, do you try to apply that?

               

              I found it in forum: https://community.jboss.org/message/757687

               

              Please share if you have any ideas.

              • 4. Re: Retry Interceptor in AS7?
                jaikiran pai Master

                AS7 is backed by EJB client API which has this kind of retry functionality already built in. Moreover, the EJB remote proxies in AS7 aren't "tied" to a specific node so a different node gets reused whenever necessary (like one of the nodes going down). You don't need an interceptor for this.

                • 5. Re: Retry Interceptor in AS7?
                  james viet Newbie

                  Hi Jaikiran,

                   

                  I have 1 question1:

                   

                  I'm migrating my application from JBoss 5 to JBoss 7.

                  In JBoss 5 we have some interceptor already denifed in jmx-invoker-service.xml (they use for create Session, authentication user with DB ....)

                  When client calls to server to invoke method, all interceptor from jmx-invoker-service.xml will be intercepted.

                   

                  eX:

                  @Override 

                  public Object invoke(Invocation invocation) throws Throwable {

                  String type = invocation.getType();

                  if (type.equals(Invocation.OP_INVOKE))

                  {

                  String opName = invocation.getName(); 

                  if (opName.equals("invoke")) { 

                  Object[] args = invocation.getArgs();

                  org.jboss.invocation.Invocation inv = (org.jboss.invocation.Invocation) args[0]; // Get the caller, we assume this one is authenticated

                  Principal caller = inv.getPrincipal();

                  ...

                  But now when I migrate to JBoss 7, the old behavior and some class exist in JBoss 5 was removed (ex: org.jboss.invocation.Invocation, ...).

                   

                  I would like to find another way to do that when migrating my application to JBoss 7.

                   

                  Would you like give me some advices for do that, can I apply EJB3 interceptor?

                   

                  Thanks,