On the client side, you determine when message transmission should occur by specifying policies. A policy tells the QAnywhere Agent when a message should be moved from the client message store to the server message store. If you do not specify a policy, transmission occurs automatically when a message is queued for delivery to the server by default. There are three pre-defined policies: scheduled, automatic, and ondemand, as well as a custom policy.
You can specify policies in two ways:
Using the QAnywhere plug-in in Sybase Central, choose the task Create an Agent Configuration File. Policies are specified on the General tab of the command file Properties dialog.
To specify custom properties, you must also choose the task Create an Agent Rule File. This task creates a file with a .qar extension; this extension is a Sybase Central convention.
Run qaagent on the command line using the -policy option. For custom policies, create a rules file and specify it.
The scheduled policy instructs the Agent to perform a transmission at a specified time interval.
To invoke a schedule, choose scheduled in the command file Properties dialog or specify the keyword when you start the QAnywhere Agent:
qaagent -policy scheduled [ interval ] ...
where interval is in seconds.
The default is 900 seconds (15 minutes).
When a schedule is specified, every n seconds the Agent performs message transmission if any of the following conditions are met:
New messages were placed in the client message store since the previous time interval elapsed.
A message status change occurred since the previous time interval elapsed. This typically occurs when a message is acknowledged by the application.
For more information about acknowledgement, see:
A push notification was received since the previous time interval elapsed.
A network status change notification was received since the previous time interval elapsed.
Push notifications are disabled.
You can call the trigger send receive method to override the time interval. It forces message transmission to occur before the time interval elapses. See:
The automatic policy attempts to keep the client and server message stores as up-to-date as possible.
When using the automatic policy, message transmission is performed when any of the following conditions occurs:
PutMessage() is called. See:
A message status changes has occurred. This typically occurs when a received message is acknowledged by the application. See:
A Push Notification is received.
A Network Status Change Notification is received.
TriggerSendReceive() is called. See:
The ondemand policy causes message transmission to occur only when instructed to do so by an application.
An application forces a message transmission to occur by calling TriggerSendReceive().
When the agent receives a Push Notification or a Network Status Change Notification, a corresponding message is sent to the system queue. This allows an application to detect these events and force a message transmission by calling TriggerSendReceive(). See:
For more information about handling push notifications and network status changes, see System queue.
A custom policy allows you to define when message transmission occurs and which messages to send in the message transmission. The custom policy is defined by a set of transmission rules.
Each rule is of the following form:
schedule = condition
where schedule defines when condition is evaluated. For more information, see Rule syntax.
All messages satisfying condition are transmitted. In particular, if schedule is automatic, the condition is evaluated when any of the following conditions occurs:
PutMessage() is called. See:
A message status change has occurred. This typically occurs when a message is acknowledged by the application. See:
A Push Notification is received.
A Network Status Change Notification is received.
TriggerSendReceive ( ) is called. See: