FioranoMQ can be integrated with Sun's GlassFish Enterprise v2.1 Application Server. The sample MDB (Message Driven Bean) can be downloaded from: http://www.fiorano.com/downloads/fmq/GlassFishIntegration.zip
The .zip file included in the download contains the following files:
- fmqmdb.jar.
- readme.txt.
- A source file; FMQSenderMDB_1_4.java (which is the source of the MDB).
To observe the MDB, follow the steps below:
- Start the FioranoMQ Server.
- Run the Application Server as admin start-domains domain1
- Deploy the FioranoMQ Resource Adapater (fmq-connector-ra.rar) as a connector module. This can be done through the command line or by logging into the administration console at http://<ip>:4848. The connector module is available in the side pane of the frame under Applications.
4. Configure Connector-connection-pools (available under Resources -> Connectors in the side pane of the admin console) and Connector-resources (available under Resources -> Connectors) based on whether outbound communication from MDB is necessary.
The sample MDB demonstrated here requires that there be a Non-Transaction based Connection Factory named FMQNonXA which will be used to lookup its target destination upon which it will publish the messages received from FioranoMQ.
5. Create a new connector-connection-pool named 'outpool' and select the resource adapter as 'fmq-connector-ra' and connection definition as 'javax.jms.ConnectionFactory'. Set transaction support to 'No Transaction' in the next page as we require a non transaction based connection factory.
6. Create a new connector resource named FMQNonXA which uses the 'outpool' connection pool created.
7. Deploy the sample MDB fmqmdb.jar (Applications → EJB Applications → Deploy).
8. Start a FioranoMQ publisher on the primaryTopic and a subscriber on the secondaryTopic. The MDB reroutes all messages from the primaryTopic to the secondaryTopic.