You need to create a JMS message, object, or message producer to send a message to Queue2 once the JMS message is received inside the MDB file of the onMessage() method.
Launch the NetBeans IDE and open the Message-Driven Bean file you created in To Create the JCA Message-Driven Bean.
The file is located in the Enterprise Beans node of the JMSJCASample project.
Drag-and-drop the Session icon from the Palette panel on the right side to the inside of the onMessage() method, as shown in the figure below:
The JCA Wizard dialog box appears.
For this exercise, enter the following values:
Method Name = queueToQueue
Resource JNDI Name = jms/tx/jmq1
Click Finish.
Several Java code fragments is generated as a result, in particular the queueToQueue(...) method, which can be implemented to process the incoming message.
Save the MDB file.