Lesson 2: Run the TestMessage application

Background

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 performing 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 use this message store to send a message to another client message store.

Activity
To start the QAnywhere Agent with the TestMessage client message store
  1. From the Start menu, choose Programs » SQL Anywhere 11 » QAnywhere » Tutorial Using SQL Anywhere » QAnywhere Agent For SQLAnywhere - saclient1.

    The QAnywhere Agent connects to the first TestMessage sample client message store and manages message transmission to and from this message store.

  2. Move the first QAnywhere Agent window to the right side of your screen.

    Note

    You must allow a few seconds for the first instance of the QAnywhere Agent to start before you proceed to the next step.

  3. From the Start menu, choose Programs » SQL Anywhere 11 » QAnywhere » Tutorials Using SQL Anywhere » QAnywhere Agent For SQLAnywhere - saclient2.

    A second QAnywhere Agent starts and connects to the second TestMessage sample client message store and manages message transmission to and from this message store.

  4. Move the second QAnywhere Agent window to the left side of your screen.

To start TestMessage
  1. From the Start menu, choose Programs » SQL Anywhere 11 » QAnywhere » Tutorial Using SQL Anywhere » TestMessage -- saclient1.

  2. Move the saclient1 - TestMessage window to the right side of your screen.

  3. In the saclient1 - TestMessage window, click Tools » Options.

  4. Verify testmessage appears in the Queue Name Used To Listen For Incoming Messages field. Click Cancel.

  5. From the Start menu, choose Programs » SQL Anywhere 11 » QAnywhere » Tutorial Using SQL Anywhere » TestMessage -- saclient2.

  6. Move the saclient2 - TestMessage window to the left side of your screen.

  7. In the saclient2 - TestMessage window, click Tools » Options.

  8. Verify testmessage appears in the Queue Name Used To Listen For Incoming Messages field. Click Cancel.

Discussion

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.

  • on demand   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.

See also