A web service that demonstrates use of a JMS control to subscribe to a JMS topic. AccountPublish.jws is a companion to this sample.
Use of a JMS control with a topic
Use of a custom JMS callback
Use of JMS message properties
This sample is located in the jms folder of the WebServices project in the SamplesApp sample application. In the file system the location is:
BEA_HOME\weblogic81\samples\workshop\SamplesApp\WebServices\jms\AccountSubscribe.jws
To Run the Sample
The AccountPublish.jws and AccountSubscribe.jws samples work together. The following instructions describe how to use both services:
BEA_HOME/weblogic81/samples/domains/workshop/startWebLogic.sh
The message containing the account transaction was published to the topic by the AccountPublishJMSControl.jcx JMS control used by AccountPublish.jws. The JMS server then sent the message to all active subscribers. Since AccountSubscribe.jws is subscribed to the topic via the AccountSubscribeJMSControl.jcx JMS control, it receives the message. If you examine the two JCX files, you will see that the information you entered was encoded in both the message properties and the message body using the @jc:jms-property and @jc:jms-header properties of the JMS controls. When using JMS messaging, the senders and receivers of messages must agree on the message format at design time.