Migrate a JMS listener application to use message-driven beans
Use this task to migrate an enterprise application that uses message beans with the JMS Listener from WAS 4.0 to use EJB 2.0 message-driven beans.
This task uses a command line utility, mb2mdb, that takes as its input either a deployed MessageBean.jar module or a deployed EAR file that contains a message bean, along with the JMS listener configuration XML file that defines the WAS 4.0 message beans. The result is a new JAR or EAR module that can then be deployed directly into a WAS 5.0 application server.
To migrate a WAS 4.0 enterprise application that uses message beans to use EJB 2.0 message-driven beans, run the mb2mdb script from Qshell.
Product
The mb2mdb script is available in WAS.
Authority
No special authority is required to run this script.
Syntax
The syntax of the mb2mdb command is:
mb2mdb inputMB.jar-ear jmsListenerConfig.xml workingDirectory outputMDB.jar-ear [-keep] [-verbose] [-map listenerHome=bindingHome]Parameters
The parameters of the mb2mdb script are:
inputMB.jar-ear
This is a required parameter. The name of the deployed WAS 4.0 jar or ear file containing a stateless session message bean.jmsListenerConfig.xml
This is a required parameter. The name of the XML configuration file used to configure the WAS 4.0 JMS listeners.- workingDirectory
This is a required parameter. The name of a new or existing directory that is used to generate the new message-driven bean and package the outputMDB.jar or EAR file.Note: By default, the tool clears the working directory after it has completed. If you want to preserve the contents of the working directory, specify the -keep option.
outputMDB.jar-ear
This is a required parameter. The name of the output JAR or EAR file for the migrated message-driven bean application.-keep
Optional. This prevents the tool from clearing out the working directory after completion.-verbose
Optional. This causes the tool to display informational messages as to the progress of the migration and its parameters.-map listenerHome=bindingHome
Optional. This option provides a mechanism to map between the JNDIHomeName specified for a listener in the JMS listener configuration XML file and the default binding home name specified in the inputMB.jar-ear file.If the jmsListenerConfig.xml file contains a deployed EJB home JNDI name that is different to the default binding within the inputMB.jar-ear, use this option to map between the two names.
This enables you to install the output JAR or EAR file for the message-driven bean into an application server and bind the bean with a different JNDIHomeName than is specified in the bean's bindings.xmi.
The result of this task is a new JAR or EAR file for a message-driven bean that can then be deployed directly into a WAS 5.0 application server.
To successfully install the JAR or EAR file, you need to bind the message-driven bean against a listener port defined to the message listener service of the application server. Use the WAS administrative console to define the listener port, which defines the JMS connection factory and destination that a message-driven bean bound to it listens on. For more information about installing and configuring a JAR or EAR file for a message-driven bean, see Deploy an enterprise application to use message-driven beans.