FioranoMQ can be integrated with a JBoss application server in which an MDB deployed on JBoss can listen for messages published on FioranoMQ destinations.
This helps in leveraging the power of FioranoMQ as a JMSProvider and Jboss as Application Server.
Refer to the link below to locate the zip file corresponding to JBoss Integration with the FiroanoMQ Server:
http://www.fiorano.com/downloads/fmq/JBossIntegration.zip
This .zip file contains the files listed below:
- fmqmdb.jar.
- readme_Jboss4.txt.
- FMQSenderMDB_1_4.java (which is the source of the MDB).
- jms-ds.xml (which is an .xml file containing sample configurations required for binding the Connection Factories that are to be used).
- jboss-log4j.xml (Which is an .xml file containing suitable appenders for Fiorano logger. This file can be found in location JBOSS_HOME/server/default/conf)
29.6.1 Integrating FioranoMQ with JBoss Application Server 4.2.2
This section describes the steps to integrate FioranoMQ with the JBoss Application Server:
- Configure FioranoMQ RA in JBOSS 4.2.2. Related instructions has been provided in section 29.5.5 Configuring FioranoMQ RA in JBOSS 4.2.2
- Navigate to the file jms-ds.xml located at <%JBOSS_DIR%>\server\default\deploy\jms directory (where <%JBOSS_DIR%> is the JBoss 4.2.2 installation directory). A sample of this .xml file is provided in the zip file folder. This file contains Connection Factory bindings which are of vital importance for outbound communication. Modify this file as required.
- Navigate to the file jboss-log4j.xml located at <%JBOSS_DIR%>\server\default\conf directory (where <%JBOSS_DIR%> is the JBoss 4.2.2 installation directory). A sample of this .xml file is provided in the zip file. This file contains suitable appenders for Fiorano logger. You can change various parameters of this file to set desired log level and logger.
- Copy the file fmqmdb.jar to %JBOSS_DIR%\server\default\deploy directory.
- Start the FioranoMQ Server by selecting Start > Programs > Fiorano > FioranoMQ (or by using $FMQ_DIR/fmq/bin/fmq.sh on UNIX).
- Start the JBoss Server using the startup script run.bat (or run.sh on UNIX).
- Run a Publisher on PrimaryTopic
- Run a Subscriber on SecondaryTopic
Messages can now be sent using the application. These messages are sent on the PrimaryTopic. Messages are received on the JBoss console and are published back to the SecondaryTopic by the MDB, received by the Subscriber.
29.6.2 Integrating FioranoMQ with JBoss Application Server 4.3
Configurations are similar to Jboss AS 4.2.2
jms-ds.xml file is located in <%JBOSS_DIR%>\server\default\deploy
29.6.3 Integrating FioranoMQ with JBoss Application Server 5.1.0
In order to integrate FioranoMQ with JBoss Application Server 5.1.0 follow the steps discussed for integration FioranoMQ with JBoss Application Server 4.2.2. In addition to the steps mentioned, add the entry below to $JBOSS_HOME/server/default/deployers/metadata-deployer-jboss-beans.xml:
This element must be added to the Bean <bean name="JBossCustomDeployDUFilter" class="org.jboss.deployers.vfs.spi.structure.helpers.VirtualFileDeploymentUnitFilter"> This element is added by identifying the presence of the preceding element.
The EJB2.1 and 3 samples that are described for JBoss 4.2.2 can be used for JBoss 5 as well.
29.6.4 Integrating FioranoMQ with JBoss Application Server 6.1.0
Configurations are similar to Jboss AS 4.3
The EJB2.1 and 3 samples that are described for JBoss 4.2.2 can be used for all above versions.
29.6.5 Using EJB3 compliant MDB while integrating FioranoMQ 9 with JBoss Application Server
The EJB3 compliant MDB (available at http://www.fiorano.com/downloads/fmq/JBoss4.2.2-EJB3.zip) behaves in a manner similar to the EJB2.1 compliant sample described in the section above (and can be deployed using the same steps).
The differences between the two samples are:
- In the EJB3 sample provided, all deployment details have been specified using annotations as part of the java file itself without relying on deployment descriptors. Thus there is no ejb-jar.xml in the jar file.
- The 'destination-jndi-name' parameter has been commented out in jboss.xml while deploying it using annotations. Refer build/META-INF/jboss.xml for more details.
- Also in EJB3, the bean no longer needs to implement the MessageDrivenBean class. Hence instead of the ejbCreate and ejbRemove methods which were earlier used in EJB2.1, we now use PostConstruct and PreDestroy annotations. These two annotations are respectively used to do initialization and cleanup activities in accordance with the beans lifecycle.
Refer to the sample for more details.
Instructions on modifying the EJB3 samples are available in the readme file inside the zip folder.