Overview of Continuous Queries
When used in a query agent deployed in a TIBCO BusinessEvents cluster, continuous queries listen to and process the data stream of notifications sent from the cache. Notifications are sent when entities are added to, modified or deleted from the cache.
Unlike snapshot queries, continuous queries do not examine the cached entities themselves. Entities that were created before a query starts are not visible to it— unless they are modified while the query is running.
When used in a query agent deployed stand-alone to perform event stream processing, continuous queries listen to and process the data stream for a specified event.
Enabling Continous Query
Only query agents enabled for continuous query uses a continuous query. In the project CDD file, add the following property to the query agent properties:
be.agent.query.continuous.allow=true
By default this property is set to false. Only agents with this property set to true will attempt to use continous query.
Executing a Continuous Query
For continuous queries, use the Query.Statement.executeWithCallback() function (and a variant of this function called Query.Statement.executeWithBatchCallback()) with the IsContinuous argument set to true.
See Callback Rule Function Data Usage. and See Two Types of Queries—Snapshot and Continuous for more information.
- Query Windows
Continuous queries use windows. A window is a boundary for analyzing data streams. It is a container in which events and concepts are held and processed by the query. The events or entities enter and leave the window as determined by the window type and how it is configured.