Details
-
Type:
New Feature
-
Status: Closed
-
Priority:
Major
-
Resolution: Complete
-
Affects Version/s: None
-
Fix Version/s: 2.0 GA (Kay)
-
Environment:Spring Data GemFire + Pivotal GemFire
-
Reference URL:
-
Sprint:Kay RC3
Description
After building an example (CQ with JavaConfig) in the Spring GemFire Examples project showing how to configure SDG's Continuous Queries infrastructure support in JavaConfig, I realized that I could add additional support in thew new Annotation configuration model to simplify the setup and configuration of registering CQs and Listeners/callbacks that process CQ events.
Essentially, I will introduce 2 new Annotations, @EnableContinuousQueries to enable the SDG CQ infrastructure along with @ContinuousQuery.
@ContinuousQuery will be a POJO method-level annotation meant to define the CQ query and handler method that should be called back upon receiving a CQ event for that particular query.
For example...
class MyApplicationContinuousQueriesAndHandlers { @ContinuousQuery(query = "SELECT * FROM /Orders o WHERE o.total > 1000") public void handleExpensiveOrders(CqEvent event) { ... }
The user can enable CQ using the @EnableContinuousQueries annotation, as stated above, like so...
@Configuration
@EnableContinuousQueries
class ApplicationConfiguration {
...
}
This will be very similar to the core Spring Framework's "Annotation-driven listener endpoints"