Debug: putting a test message on an input queue

You can put a message on an input queue to test a message flow that you are debugging.

Before you start

Complete the steps described in: Attaching the flow debugger to an execution group for debugging.

If your message flow includes MQInput and MQOutput nodes, you can test the flow by putting a message on the input queue of your first MQInput node.

You can use the command line interfaces or WebSphere® MQ Explorer (if you have WebSphere MQ Version 6 installed) or WebSphere MQ Services (if you have WebSphere MQ Version 5.3 installed) to put a message to a queue.

You can also use the Test Client as a repeatable alternative. To use the Test Client, complete the steps described in the following sections:

If the message is processed by the message flow and is put on an output queue, you can retrieve it from that queue. See: Debug: getting a test message from an output queue.

Configuring and using an enqueue file

To configure an enqueue file so that you can use it to send a test message:

  1. Switch to the Broker Administration perspective.
  2. On the workbench toolbar, click the arrow on the Put a message onto a queue icon Put a message onto a queue.
  3. On the drop-down menu, click Put Message to invoke the New Enqueue Message File wizard.
  4. Select the message flow project containing the message flow that you are debugging.
  5. In the File name field, enter a name for the file to create (the extension .enqueue is added automatically).
  6. Click Finish. The enqueue file is created, and a view opens showing its details.
  7. Enter the names of the queue manager and the queue for the input node for this flow. Queue manager names are case-sensitive; check that you enter the name correctly.

    If you are putting a message onto an input queue that is on a remote computer, ensure that the queue manager of the associated broker has a server-connection channel called SYSTEM.BKR.CONFIG.

  8. If you are putting a message onto a remote queue, enter values to identify the host and port of the computer that is hosting the queue.
  9. Optional: Click the MQMD tab to customize the fields of the MQMD header. Read descriptions of these fields in the Application Programming Reference section of the WebSphere MQ Version 6 information center online or the WebSphere MQ Version 5.3 book on the WebSphere MQ library Web page; the constants are listed in the Constants section or book.
  10. Optional: Click the Configuration tab and select MQ Message Headers to customize the fields of the MQMD header. Read descriptions of these fields in the Application Programming Reference section of the WebSphere MQ Version 6 information center online; the constants are listed in the Constants section.

    Click MQ Message Header "Default Header" to view the settings for the message header that is used for the test message. You can edit the options for the default header, or alternatively, you can create a new header to edit:

    1. Click MQ Message Headers.
    2. Click Add and enter a unique name for the header.
    3. Edit the header settings.
    4. Click the Events tab, and select the appropriate header for your message from the Header list.
  11. Click File > Save to save the file.
  12. Optional: To put the message to the queue immediately from this window, click Write to queue.
  13. Click the arrow on the Put a message onto a queue icon Put a message onto a queue to see your enqueue file listed on the drop-down menu.
  14. Click this file on the menu, (or if it is number 1 on the menu, just click the icon itself) to put a message to the queue. If you have set appropriate breakpoints, the flow debugger pauses the flow at the next one.

To find your enqueue file at a later time, switch to the Broker Application Development perspective and expand the navigation tree for your message flow project. Double-click your enqueue file to open it in a view.

Optional: Adding data to your message

If you want to add just a small amount of test data in your test message, type the data into the "Message data" window:

  1. Open your enqueue file and select the Browse tab.
  2. Type your test data directly into the "Message data" window.
  3. Put the test message by selecting the General tab and clicking Write to queue.

Optional: Using a file of sample data

If you want your test message to contain a larger quantity of sample data (for example some structured XML), first create or import a file containing that data, then get the enqueue file to use it. Follow the optional steps to use either of these methods of creating and adding data.

To get the enqueue file to use a file that contains sample data:

  1. Create or import the message data file, as described below.
  2. Open your enqueue file; at File name click the Browse button.
  3. In the "Add a message" window, select your file and click OK.
  4. Click File > Save when you have finished.
  5. To see the data in your file, select the Browse tab at the bottom of the enqueue view. If you want to change the data, either type some text into the "Message data" window, or edit the file by double-clicking it in the Broker Development view.
    Tip: If you decide to experiment with using an XML data file instead of text, do not forget to edit the properties for the input node of your message flow and set the Message Domain to XML. When your message appears in the Flow Debugger in the Variables view, the XML is parsed and expandable in the tree.

Optional: Creating a file of sample data for the message

To create a new file of sample data:

  1. Switch to the Broker Application Development perspective.
  2. Click File > New > Other.
  3. Click Simple, then File.
  4. In the New File window, select the project in which you want to keep the file, then at File name enter a name and extension for your file. If your file contains XML, make sure that the extension is .XML.
  5. Click Finish. The file is created and appears in the Broker Development view. A view opens with an appropriate editor (text or XML) for the file.
  6. Edit the file and enter the text or XML data that you want in it.
  7. Click File > Save when you have finished.

You can now select the file as described in the Optional: Using a file of sample data section. You can also double-click the file to open it in an appropriate editor.

Optional: Importing an existing file of sample data for the message

If you already have a file on your computer containing sample data that you want to use in a test message, use these steps to import the data into the workbench. If the file contains XML, make sure that it has the extension .XML.

  1. Switch to the Broker Application Development perspective.
  2. Click File > Import.
  3. In the list of wizards, select File system then click Next.
  4. At Directory, click the Browse button and navigate to the folder containing your file then click OK. A list of the files in the folder appears.
  5. In the list of files, select the check box next to the file that you want to import.
  6. At Folder, click the Browse button and select the project in which you want to keep the file.
  7. Click Finish.

After you have imported the file as described here, a copy of your file is stored in the workbench data space along with all other workbench files for your configuration. Your original file is not used directly again.

The file appears in the Broker Development view in your chosen project, and you can select it as described in the Optional: Using a file of sample data section on this page. You can also double-click it to open it in an appropriate editor.

Related concepts
Flow debugger overview
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009.
Last updated : 2009-01-07 15:21:55

ag16710_