Using the JMS JCA Wizard

ProcedureTo Create a JCA Message-Driven Bean for the Destination

  1. From the NetBeans Palette window, drag an instance of the JMS Session into the onMessage() method in the Java Editor.

    The JMS Adapter Declaration dialog box appears.

    Figure 23 Reply Method

    Reply Method

  2. Enter reply as the method name and click Finish.

    The Java code for the JMS Session is populated into the Java Editor.

  3. In the reply method enter the following code:

    jmsSession.createProducer(message.getJMSReplyTo()).send(message);

    Figure 24 Reply Method in the Java Editor

    Reply Method in the Java Editor

    This code sends the incoming message to the reply destination.

  4. Save the file.

  5. Build and deploy the project.