Implementing a Continuous Query
You can specify CQs for any client region.
Here are the high-level steps for implementing a continuous query, with links to more detailed information in this chapter.
- Make sure your system is configured properly to run CQs. See Configuring for Continuous Querying.
- Decide what data to track on the server and write your queries. Use your criteria for tracking data changes to write your CQ queries. See Writing the Continuous Query.
Determine how to handle the CQ events on the client and write your listeners.
Each CQ can have any number of listeners. In addition to your core CQ listeners, you might have listeners that you use for all CQs to track statistics or other general information. See Writing the CQ Listener.
Write the client code to put the queries and their listeners into named CQ queries and execute the queries. Make sure you close the queries if your client no longer needs them and when the client exits. See Running the Continuous Query Code.
Write any code you need for monitoring and managing your CQ query. See Managing Continous Queries.
Run your code, monitor and tune as needed.