TestMessage is a simple application that uses QAnywhere to send and receive text messages. Text messaging is used in this tutorial because it provides a simple and accessible demonstration of messaging. QAnywhere is, however, not just a text messaging system; it provides general purpose application-to-application messaging.
In this lesson, you are carrying out activities at a client. Typically, clients run on separate computers from the server.
In this lesson, you start the client message store that is part of the TestMessage sample. In Lesson 3, you will use this message store to send a message to another client message store.
From the Start menu, choose Programs > SQL Anywhere 10 > QAnywhere > Agent for Client1 Sample.
This starts an instance of the QAnywhere Agent. This Agent connects to the first TestMessage sample client message store and manages message transmission to and from this message store.
Move the first QAnywhere Agent window to the right side of your screen, which represents the first client in this tutorial.
From the Start menu, choose Programs > SQL Anywhere 10 > QAnywhere > Agent for Client2 Sample.
This starts another instance of the QAnywhere Agent. This Agent connects to the second TestMessage sample client message store and manages message transmission to and from this message store.
Move the second QAnywhere Agent window to the left side of your screen, which represents the second client in this tutorial.
Each of the QAnywhere Agent windows displays a client message store ID, called client1 and client2.
From the Windows Start menu, choose Programs > SQL Anywhere 10 > QAnywhere > TestMessage for Client1 Sample.
The TestMessage window is displayed. The application is connected to the first TestMessage client message store that you started in the above procedure.
Move the TestMessage window to the right side of your screen, together with the first QAnywhere Agent. Both these components belong on the first client.
Check the message queue.
From the TestMessage - client 1 Tools menu, choose Options. You will see that the queue name testmessage is specified. This is the queue that the TestMessage application is listening on for incoming messages. Do not change this name.
From the Windows Start menu, choose Programs > SQL Anywhere 10 > QAnywhere > TestMessage for Client2 Sample.
The TestMessage window is displayed. The application is connected to the second TestMessage client message store that you started in the above procedure.
Move the TestMessage window to the left side of your screen, together with the second QAnywhere Agent. Both these components belong on the second client.
Check the message queue.
From the TestMessage - client 2 Tools menu, choose Options. You will see that the queue name testmessage is specified. This is the queue that the TestMessage application is listening on for incoming messages. Do not change this name.
You can configure the way that the QAnywhere Agent monitors messages by setting a message transmission policy. This sample is designed to only work with the automatic or scheduled policy, and it starts the QAnywhere Agent using the automatic policy. The QAnywhere policies are:
scheduled This policy setting instructs the QAnywhere Agent to transmit messages periodically. If you don't specify an interval, the default is 15 minutes.
automatic This default policy setting causes the QAnywhere Agent to transmit messages whenever a message to or from the client message store is ready for delivery.
ondemand This policy setting causes the QAnywhere Agent to transmit messages only when instructed to by an application.
custom In this mode, you provide a set of rules to specify more complicated transmission behavior.
QAnywhere messages are delivered to a QAnywhere address, which consists of a client message store ID and a queue name. The default ID is the computer name on which the QAnywhere Agent is running. Each message store requires its own QAnywhere Agent. Each application can listen to multiple queues, but each queue should be specific to a single application.