Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Overview of Continuous Queries

Continuous queries, when used in a query agent deployed in a TIBCO BusinessEvents® cluster, 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 start 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 Continuous Query

Only query agents enabled for continuous query use 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` attempts to use continuous query.

Tip: A continuous query must be run using the `Query.Statement.executeWithCallback()` function. Snapshot queries can also use this function. However, when you set the argument `IsContinuous` to true, the query runs as a continuous query. See Overview of Continuous Queries for more details.

## Optimizing Continuous Query

To optimize continuous queries containing aggregate functions such as sum(), add the property to the project CDD file to the query agent properties:

    be.engine.query.optimize.aggregate=true

The default value is `false`.

Setting this property to `true` maintains a single value in aggregate functions instead of accumulating all the previous values and thus optimizes memory consumption.

## Running 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.

## Ending a Continuous Query

A continuous query only ends when one of the following occurs:

- You explicitly stop it.
- Its query statement is closed.
- Its query definition is deleted.
- The query agent engine stops.

Subtopics

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.