Tutorial: Working with the sample application

Complete the tasks in this tutorial to verify that the pattern has been configured by viewing the artefacts created in WebSphere® Message Broker, WebSphere MQ, and WSRR. Then, running the sample application sends some messages that are routed to different queues based on the policies provided with the sample.

Before you begin

This tutorial requires that the IBM® SOA Policy Pattern has been installed and deployed. See Downloading and installing the pattern.

About this task

The sample policies and applications that are provided with the IBM SOA Policy Pattern can be used to send some sample messages that are routed using the two sample policies to two sample JMS destinations based on the PolicySelector value in the message. This tutorial describes how to examine the policies created in WSRR using the Business Space user interface. The tutorial also describes sending sample messages with the PolicySelector value of GID007, and viewing the messages on the queue for the JMS destination in WebSphere MQ before and after the messages are received.

Procedure

  1. View the deployed system in the appliance:
    1. Click Instances > Virtual Systems.
    2. From the list of instances in the Virtual System Instances window, select the instance that was deployed. The instance details are displayed.
    3. To see the virtual machines that are deployed as part of the instance, expand the Virtual machines section in the instance details pane.
  2. View the sample policies in WSRR:
    1. In the instance details pane, expand the Consoles section.
    2. To connect to Business Space, click WSRR Business Space. For more information about connecting to Business Space, see Connecting to WSRR.
    3. Log in to Business Space with the WebSphere administrative username and password. For more information about the default passwords that were created when the pattern was deployed, see WSRR Standalone server part.
    4. Open the Operations space:
      1. Click Go To Spaces at the top of the page. The Go To Spaces dialog is displayed.
      2. Click on the space for Operations users. The specific name will depend on what was specified when the space was created.
    5. On the Overview tab, enter SampleRoutingSchedule01 into the search box.
    6. In the search types list, select Policy Document and click Search. The Collection widget lists the SampleRoutingSchedule01 policy.
    7. Select the SampleRoutingSchedule01 policy. The policy details are shown in the Detail widget. Note that the PolicySelector value is GID007. This is the PolicySelector value that your sent messages must contain to be routed by using the SampleRoutingSchedule01 policy.
    8. Click the Edit icon to view more policy details. In the Actions section, note the JMS endpoint destination that messages are routed to.
  3. Send some sample JMS messages with a PolicySelector value of GID007. These messages will be routed by using the SampleRoutingSchedule01 policy:
    1. Open a command prompt.
    2. In the installation directory for the SOA Policy pattern, navigate to /opt/ibm/mqsi/8.0.0.1/sample/JMSSendReceive.
    3. To send a sample message, enter the following command as virtuser:
      java com.ibm.jms.SendJMSMessage file:///home//virtuser//JNDI-DIR  
      '<data><msg>11</msg></data>' GID007
      For more information about the sample application, see Samples. Repeat this command to send as many messages as you would like.
  4. Connect to the WebSphere MQ system and view the queues:
    1. In the instance details pane, expand the Consoles section.
    2. To connect to the WebSphere MQ system using VNC, click VNC. For more information about connecting to WebSphere MQ, see Connecting to the WebSphere MQ system.
    3. Authenticate using the virtuser credentials. For more information about the default passwords created when the pattern was deployed, see the part details WebSphere Message Broker Basic part.
    4. To see various queues created by this pattern, including the depth of the queue, you can run the following command in the shell prompt:
      runmqsc <MB8QMGR>
      For example, the DESTINATION1_OUTQ queue contains 14 messages in the following output:
      1 : DIS QL(DES*) CURDEPTH
      AMQ8409: Display Queue details.
         QUEUE(DESTINATION1_OUTQ)                TYPE(QLOCAL)
         CURDEPTH(14)
      AMQ8409: Display Queue details.
         QUEUE(DESTINATION2_OUTQ)                TYPE(QLOCAL)
         CURDEPTH(0) 
  5. Receive the sample messages:
    1. Open a command prompt.
    2. In the installation directory, navigate to /opt/ibm/mqsi/8.0.0.1/sample/JMSSendReceive.
    3. To receive all of the sample JMS messages from the JMS endpoint destination specified in the policy document for the SampleRoutingSchedule01 policy, enter the following command as virtuser:
      java com.ibm.jms.ReceiveJMSMessage file:///home//virtuser//JNDI-DIR DESTINATION1_OUT
      For more information about the sample application, see Samples.
    4. To access the stdout log to see the output message, click Instances > Virtual system , expand the Virtual machines section, and click remote_std_out.log.
  6. Optional: Repeat step 4 to verify that the messages are no longer on the queue.
  7. Optional: Repeat step 3 and send some messages with a PropertySelector value of GID008. This will route the messages to a different JMS endpoint destination.
    Draft comment:
    Related Links below - are there any more related links?

Task Task

Feedback

Timestamp icon Last updated: Thursday, 3 July 2014
http://publib.boulder.ibm.com/infocenter/prodconn/v1r0m0/topic/com.ibm.scenarios.soawmbwsrr.doc/topics/tutorial_sample.htm