[jboss-user] [EJB3] - Change "maxSession" ActivationConfigProperty dynamically on MDB

Hushen Savani do-not-reply at jboss.com
Wed Feb 1 02:04:49 EST 2012


Hushen Savani [https://community.jboss.org/people/hushen.savani] created the discussion

"Change "maxSession" ActivationConfigProperty dynamically on MDB"

To view the discussion, visit: https://community.jboss.org/message/649827#649827

--------------------------------------------------------------
Hi Community,

     I am using JBossAS-5.1.0.GA with HornetQ-2.2.5.Final. I am using Message Driven Beans in my application. I wanted to configure MDBs maxSession and maxPoolSize configurable instead of hardcoding inside the code. So, I have converted my MDB to AspectDomain and configured parameters in *-aop.xml. Following is my sample-aop.xml file:

*sample-aop.xml*: 

<?xml version="1.0" encoding="UTF-8"?>
<aop xmlns="urn:jboss:aop-beans:1.0">
  
   <domain name="ProcessingEntitiesQueueListenerMDB" extends="Message Driven Bean" inheritBindings="true">
      <annotation expr="!class(@org.jboss.ejb3.annotation.DefaultActivationSpecs)">
         @org.jboss.ejb3.annotation.DefaultActivationSpecs (value={@javax.ejb.ActivationConfigProperty(propertyName=destinationType, propertyValue=javax.jms.Queue), @javax.ejb.ActivationConfigProperty(propertyName=destination, propertyValue=queue/mocmProcessingQueue), @javax.ejb.ActivationConfigProperty(propertyName=maxSession, propertyValue=30)})
      </annotation>
  
     <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">
         @org.jboss.ejb3.annotation.Pool (value=StrictMaxPool, maxSize=30, timeout=1000000)
      </annotation>

   </domain>

<domain name="HornetQSessionBean" extends="Stateless Bean" inheritBindings="true">
      <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
          @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=20000, timeout=10000)
      </annotation>
   </domain>
</aop>



*And My Message Driven Bean is as following*:

@MessageDriven
@AspectDomain("ProcessingEntitiesQueueListenerMDB")
@TransactionManagement(value= TransactionManagementType.CONTAINER)
@TransactionAttribute(value= TransactionAttributeType.NOT_SUPPORTED)
@ResourceAdapter("hornetq-ra.rar")
public class ProcessingEntitiesQueueListenerMDB implements MessageListener { 
     ......
     ......
     .....
}


After deploying the sample-aop.xml, I am able to control these parameters as per I configure.

Now, what happens here is that, if I chage maxSession/max Pool size equals to 40 from 30 on runtime, the changes are not reflected dynamically. Hence, I tried redeploying sample-aop.xml on runtime. But again, new values to these parameters are not bound to my MDB on runtime. 

Pl. suggest some pointers on the same to change these binding dynamically on runtime.

Thank you.

Best Regards,
 Hushen Savani
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/649827#649827]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120201/2218ad1a/attachment.html 


More information about the jboss-user mailing list