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.
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
- View the deployed system in the appliance:
- Click .
- From the list of instances in the Virtual System Instances
window, select the instance that was deployed. The instance details
are displayed.
- To see the virtual machines that are deployed as part
of the instance, expand the Virtual machines section
in the instance details pane.
- View the sample policies in WSRR:
- In the instance details pane, expand the Consoles section.
- To connect to Business Space, click WSRR
Business Space. For more information about
connecting to Business Space, see Connecting to WSRR.
- 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.
- Open the Operations space:
- Click Go To Spaces at the top of the page.
The Go To Spaces dialog is displayed.
- Click on the space for Operations users. The specific name will
depend on what was specified when the space was created.
- On the Overview tab, enter SampleRoutingSchedule01 into
the search box.
- In the search types list, select Policy Document and
click Search. The Collection
widget lists the SampleRoutingSchedule01 policy.
- 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.
- Click the Edit icon to view more policy details. In
the Actions section, note the JMS endpoint
destination that messages are routed to.
- Send some sample JMS messages with a PolicySelector value
of GID007. These messages will be routed by using the SampleRoutingSchedule01
policy:
- Open a command prompt.
- In the installation directory for the SOA Policy pattern,
navigate to /opt/ibm/mqsi/8.0.0.1/sample/JMSSendReceive.
- 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.
- Connect to the WebSphere MQ
system and view the queues:
- In the instance details pane, expand the Consoles section.
- 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.
- 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.
- 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)
- Receive the sample messages:
- Open a command prompt.
- In the installation directory, navigate to /opt/ibm/mqsi/8.0.0.1/sample/JMSSendReceive.
- 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.
- To access the stdout log to see the output message,
click , expand the Virtual machines section,
and click remote_std_out.log.
- Optional: Repeat step 4 to verify that the
messages are no longer on the queue.
- 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.
Related Links below - are there any more related links?