3

I am working on a Notification Service using IBM MQ messaging provider with JBoss eap 6.1 environment. I am successfully able to send messages via MQ JCA provider rar i.e. wmq.jmsra.rar file. However on consumer part my current configuration looks like this

    @MessageDriven(   
    activationConfig = {   
            @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),   
            @ActivationConfigProperty(propertyName="destination", propertyValue="F2.QUEUE"),
            @ActivationConfigProperty(propertyName="providerAdapterJNDI", propertyValue="java:jboss/jms/TopicFactory"),
            @ActivationConfigProperty(propertyName="queueManager", propertyValue="TOPIC.MANAGER"),
            @ActivationConfigProperty(propertyName="hostName", propertyValue="10.239.217.242"),
            @ActivationConfigProperty(propertyName="userName", propertyValue="root"),
            @ActivationConfigProperty(propertyName = "channel", propertyValue = "TOPIC.CHANNEL"),
            @ActivationConfigProperty(propertyName = "port", propertyValue = "1422")   

    }) 

My problem is that consumer of this service does not want to add any port numbers, hostName, queueManager properties in these beans. Also they do not want to use ejb-jar.xml to externalize these configs. I have researched and found that we can add a domain IBM Message Driven Bean but with no success. Any suggestions on what I can do here to externalize all these configurations ?

EDIT: Adding --> The JCA resource adapter is deployed at consumer end if it makes it any easier.

Thanks

Mohit Dhuper
  • 423
  • 1
  • 8
  • 17

2 Answers2

1

You can actually externalize an MDBs activation spec properties to the server configuration file.

Create the ejb-jar.xml file, but do not put the actual value in the file, use a property placeholder:

<activation-config-property>
    <activation-config-property-name>hostName</activation-config-property-name>
    <activation-config-property-value>${wmq.host}</activation-config-property-value>
</activation-config-property>

Do this for all of the desired properties.

Ensure that property replacement for Java EE spec files (ejb-jar.xml, in this case) is enabled in the server configuration file:

<subsystem xmlns="urn:jboss:domain:ee:1.2">
   <spec-descriptor-property-replacement>true</spec-descriptor-property-replacement>

Then, in the server configuration file, provide values for your properties:

<system-properties>
    <property name="wmq.host" value="10.0.0.150"/>

Once your MDBs are packaged, you will not need to change any of the files in the MDB jar - just provide the properties in the server configuration.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Doug Grove
  • 962
  • 5
  • 5
0

you can avoid to add host name, port number and so on in MDB, you just want to define destinationType in MDB, and rest of the thing u can configure in your application server, like Activation Specification, Queues and Queue Connection Factories. I have done the same thing but i used IBM Websphere Application Server.

Prafulla
  • 41
  • 4