5 Replies Latest reply on Aug 24, 2007 9:38 AM by Adrian Brock

    assigning java thread priority to MDB ?

    ian Newbie

      We have multiple JMS Queues where each queue is handled by a MessageDrivenBean.

      Let say there are 2 queues: queue/HighPriority and queue/LowPriority.

      Is there a way to specify the thread priority for
      the 2 queues during deployment ? e.g. MDB that handles the queue/LowPriority is assigned a lower java.lang.Thread priority than the other one ?

        • 1. Re: assigning java thread priority to MDB ?
          Elias Ross Master


          This is what I would do in my MDB in ejbCreate:

          Thread.currentThread().setPriority(XXX)

          I don't recall seeing a way to set this is ejb-jar.xml or jboss.xml

          • 2. Re: assigning java thread priority to MDB ?
            Michael Jürgens Newbie

            Hello,
            is there any solution about that?
            I tried to set the thread priority to 2 in ejbCreate but
            after a restartDelivery the priority of the thread is again 5.

            Any solution.

            • 3. Re: assigning java thread priority to MDB ?
              Michael Jürgens Newbie

              I´ve an idea about that.
              It is possible to put a ThreadPriorityInterceptor into the interceptorchain of the "Standard Message Driven Bean"?


              • 4. Re: assigning java thread priority to MDB ?
                Steve Matyas Newbie

                As I'm not familiar completely with how to modify the SMDB configuration, how exactly would you modify it to introduce a ThreadPriorityInceptor?

                Example config (see conf/standardjboss.xml)

                <container-configuration>
                 <container-name>Standard Message Driven Bean</container-name>
                 <call-logging>false</call-logging>
                 <invoker-proxy-binding-name>message-driven-bean</invoker-proxy-binding-name>
                 <container-interceptors>
                 <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
                 <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
                 <interceptor>org.jboss.ejb.plugins.RunAsSecurityInterceptor</interceptor>
                 <!-- CMT -->
                 <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
                 <interceptor transaction="Container">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
                 <interceptor transaction="Container">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
                 <!-- BMT -->
                 <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
                 <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT</interceptor>
                 <interceptor transaction="Bean">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
                 <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
                 </container-interceptors>
                 <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
                 <instance-cache></instance-cache>
                 <persistence-manager></persistence-manager>
                 <container-pool-conf>
                 <MaximumSize>100</MaximumSize>
                 </container-pool-conf>
                 </container-configuration>




                • 5. Re: assigning java thread priority to MDB ?
                  Adrian Brock Master

                   

                  "smatyas" wrote:
                  As I'm not familiar completely with how to modify the SMDB configuration, how exactly would you modify it to introduce a ThreadPriorityInceptor?

                  Example config (see conf/standardjboss.xml)

                  <container-configuration>
                   <container-name>Standard Message Driven Bean</container-name>
                   <call-logging>false</call-logging>
                   <invoker-proxy-binding-name>message-driven-bean</invoker-proxy-binding-name>
                   <container-interceptors>
                  
                   <interceptor>com.acme.MyInterceptorHere</interceptor>
                  
                   <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
                   <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
                   <interceptor>org.jboss.ejb.plugins.RunAsSecurityInterceptor</interceptor>
                   <!-- CMT -->
                   <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
                   <interceptor transaction="Container">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
                   <interceptor transaction="Container">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
                   <!-- BMT -->
                   <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
                   <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT</interceptor>
                   <interceptor transaction="Bean">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
                   <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
                   </container-interceptors>
                   <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
                   <instance-cache></instance-cache>
                   <persistence-manager></persistence-manager>
                   <container-pool-conf>
                   <MaximumSize>100</MaximumSize>
                   </container-pool-conf>
                   </container-configuration>