javajmswildflyjboss-mdb

How to make MDB Activation Spec contextual properties configurable?


In our project, we are are using an MDB that listens for a message on a specific queue. It is defined as an annotation.

Example:

@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "20")})

.

In order to change the value of the maxSessions, the code has to be compiled everytime. Even if i configure it in ejb-jar.xml instead of as an annotation , i need to compile the code and generate EAR file.

Is there a way to make it user configurable(read from properties file) so that the recompilation of code is not required and by just changing the maxSession value to "30" and restarting the jboss, it should be working.

Kindly help.

Reference Code:

@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "ABCQueue"),
@ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "20"),    @ActivationConfigProperty(propertyName="maxMessagesPerSessions",propertyValue="15")})
public class ABCMDB implements MessageListener
{
   ----------- 
}

Solution

  • I started to write a gist about Wildfly8 and Websphere MQ integration, allowing to configure and maintain environment contextual configuration for MDB or JMS messages producers.

    Basically, I had to declare a jboss-ejb3.xml custom deployment descriptor in my application which use system properties for contextual configuration used by my MDB.

    System-properties are configured in wildfly standalone-full.xml file, under system-properties element. So not in a property file, but to my view standalone-full.xml configuration is a good location for such configuration.

    Here is the link : https://gist.github.com/remibantos/33c366803f189db9b225