Making maxSession property configurable for a specific MDB in JBoss EAP 5.1
Asked Answered
F

3

5

How to make maxSession value for an MDB user-configurable?

There is an MDB that listens for a message from a specific queue. It is defined as an annotation.

@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "5").

In order to change the value of the maxSession, the code has to be compiled everytime.

Is there a way to make it user configurable so that there is no build required and without restarting jboss?

Kindly help.

Foredo answered 7/9, 2011 at 9:13 Comment(0)
C
4

This is the way to externalize this setting from ear:

https://community.jboss.org/thread/178162

But restart is still required.

Update

Found a way to apply new maxSession with system property reference in ejb-jar.xml:

<activation-config-property>
   <activation-config-property-name>maxSession</activation-config-property-name>
   <activation-config-property-value>${my.mdb.maxSession:30}</activation-config-property-value>
</activation-config-property>

Full JBoss restart is not required, only ear redeploy is needed in this case.

It works for all JBoss versions until JBoss AS 7.

Note that maxSession must be in sync with max pool size: https://community.jboss.org/message/549083#549083

Cassatt answered 20/3, 2012 at 13:54 Comment(1)
System property expansion support was reintroduced since JBoss AS 7.1.2.Cassatt
M
0

Note as well, that both the number of sessions and the instance pool size can be specified in an AOP configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<aop xmlns="urn:jboss:aop-beans:1.0">
   <domain name="IBMMQ Message Driven Bean" extends="Message Driven Bean" inheritBindings="true">
      <annotation expr="class(*)">
          @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=10, timeout=10000)
      </annotation>
      <annotation expr="!class(@org.jboss.ejb3.annotation.DefaultActivationSpecs)">
         @org.jboss.ejb3.annotation.DefaultActivationSpecs (value={@javax.ejb.ActivationConfigProperty(propertyName = "channel", propertyValue = "SSL.CLIENTS"), @javax.ejb.ActivationConfigProperty(propertyName = "queueManager", propertyValue = "SSLQM"), @javax.ejb.ActivationConfigProperty(propertyName = "hostName", propertyValue = "10.0.0.124"), @javax.ejb.ActivationConfigProperty(propertyName = "port", propertyValue = "1415"), @javax.ejb.ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"), @javax.ejb.ActivationConfigProperty(propertyName = "sslCipherSuite", propertyValue = "SSL_RSA_WITH_3DES_EDE_CBC_SHA")})
      </annotation>
   </domain>
</aop>

You then add the annotation:

@AspectDomain("IBMMQ Message Driven Bean")

to your MDB. This is can be used to externalize both the number of seesions and the instance pool size.

Murrumbidgee answered 15/2, 2015 at 15:44 Comment(0)
G
0

According to this how many Message Driven Beans are created in Jboss? maxSession can't exceed the setting of StrictMaxPool. So when tweaking maxSession - this setting need to be changed as well!

Gromwell answered 8/4, 2015 at 7:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.