com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Sample 0115 - Quartz scheduler based alerts

Introduction

This sample demonstrates how to set up an execution plan with a quartz scheduler based cron window for generating periodic alerts on build failures. 

The execution plan used in this sample is as follows:

from buildStatisticsStream[isBuildFailed == true]#window.cron("0 0 1 * * ?")
select project, productTeam, lastCommitter, count(timeStamp) as totalBuildFailures
group by project
insert into buildFailureStream;

The first query,

  • Receives events through the buildStatisticsStream.
  • Adds events that satisfy the condition isBuildFailed == true to a cron window. The cron window is configured to output at 1 am every day using the cron notation.
  • Selects the attributes project, productTeam, lastCommitter, count(timeStamp) as totalBuildFailures.
  • The group by clause causes the count() to be calculated per project.
  • Outputs events to the buildFailureStream.

Prerequisites

See Prerequisites in CEP Samples Setup.

Building the sample

Start the WSO2 DAS server with the sample configuration numbered 0115. For instructions, see Starting sample CEP configurations.

This sample configuration does the following:

  • Points the default Axis2 repo to <DAS_HOME>/samples/cep/artifacts/0115 (by default, the Axis2 repo is <DAS_HOME>/repository/deployment/server).

Executing the sample

  1. Open another terminal, go to <DAS_HOME>/samples/cep/producers/http and run the following command:

    ant -Durl=http://localhost:9763/endpoints/buildStatisticsEventReceiver -Dsn=0115

    It builds the http client and publishes the events at  <DAS_HOME>/samples/cep/artifacts/0115/buildStatisticsEvents.txt to the buildStatisticsEventReceiver http endpoint.

  2. You can see the events getting received by DAS by the logs in its console. 

The above query will output the processed events at "1 am" as defined in the execurion plan. You can edit the query in "BuildFailureStatisticsPlan.siddhiql" file which is located in the <DAS_HOME>/samples/cep/artifacts/0115/executionplans directory to reschedule as per requirement.
Below is an example of a scheduler related query which outputs processed events on 5th minute each hour. For more information see Inbuilt Windows.

from buildStatisticsStream[isBuildFailed == true]#window.cron("0 5 * * * ?")
select project, productTeam, lastCommitter, count(timeStamp) as totalBuildFailures
group by project
insert into buildFailureStream;
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.