Uploaded image for project: 'Spring Data GemFire'
  1. Spring Data GemFire
  2. SGF-668

Add Annotation configuration support for Continuous Queries

    XMLWordPrintable

Details

    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"

      Attachments

        Activity

          People

            jblum John Blum
            jblum John Blum
            John Blum John Blum
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: