-
1. Re: Set "maxSession" of an MDB using XML instead of Annotations
jaikiran Dec 5, 2011 2:58 AM (in response to hushen.savani)Hushen Savani wrote:
it says that, in order the changes to be reflected, you need to set the maxSession parameter either on the resource adapter itself or via an an Activation Config Property on the MDB itself.
See this example on how you can set it as an activation config property in ejb-jar.xml http://docs.jboss.org/ejb3/docs/tutorial/1.0.7/html/Message_Driven_Beans_with_deployment_descriptor.html
-
2. Re: Set "maxSession" of an MDB using XML instead of Annotations
hushen.savani Dec 5, 2011 3:06 AM (in response to jaikiran)Hi Jaikiran,
Thanks, but this won't help either. Because, I want to configure maxSession dynamically, I don't want it be tightly bound with my application ear. I just want to configure inside the jboss xml files, not in ejb-jar.xml as this xml will wrapped inside my ear. Hence, don't want it be shipped with my ear.
-
3. Re: Set "maxSession" of an MDB using XML instead of Annotations
hushen.savani Dec 5, 2011 3:13 AM (in response to jaikiran)Pl. provide the pointer on the same.
Thanks :-)
-
4. Re: Set "maxSession" of an MDB using XML instead of Annotations
hushen.savani Dec 6, 2011 12:57 AM (in response to hushen.savani)Hi,
Finally, I have found the solution of the above problem.
I have created a {****}-aop.xml file as following :
<?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="20")})
</annotation>
</domain>
</aop>
and have placed the same file in deploy dir.
And the annotations in Message Driven Bean has been set as following:
@MessageDriven
@AspectDomain("ProcessingEntitiesQueueListenerMDB")
@ResourceAdapter("hornetq-ra.rar")
public class ProcessingEntitiesQueueListenerMDB extends MessageServiceListenerSessionBase implements MessageListener {
........
.......
}
-
5. Re: Set "maxSession" of an MDB using XML instead of Annotations
vkopichenko Mar 23, 2012 2:59 PM (in response to hushen.savani)I've also tried to find a way to externalize the maxSession property out of ear.
But had no success with this solution under JBoss 4.2.3.GA. DefaultActivationSpecs were not taken into account.
Extensive googling gave a hint to alternative solution with using system properties in ejb-jar.xml. It works with all versions before JBoss AS 7.
So now I can just update property in deploy/properties-service.xml then touch ear to redeploy and new setting gets applied.
No full JBoss restart is needed.