Prefer Application Time Oracle CQL Query Restrictions

21-4 Oracle Complex Event Processing Developers Guide wlevs:listener bean class=com.bea.wlevs.example.helloworld.HelloWorldBean wlevs:listener wlevs:adapter beans 5. Optionally, configure the channel downstream from the input adapter helloworldInputChannel to configure an application timestamp based on an appropriate event property as Example 21–4 shows. For simple failover, you can use system timestamps because events are not correlated between servers. However, it is possible that slightly different results might be output from the buffer if application timestamps are not used. In this example, event property arrivalTime is used. The wlevs:expression should be set to this event property. Example 21–4 Application Timestamp Configuration ... wlevs:channel id=helloworldInputChannel event-type=HelloWorldEvent wlevs:listener ref=helloworldProcessor wlevs:source ref=myHaInputAdapter wlevs:application-timestamped wlevs:expressionarrivalTimewlevs:expression wlevs:application-timestamped wlevs:channel ... 6. Configure the Oracle CEP high availability buffering output adapter. Set the instance property windowLength to zero 0 as Example 21–5 shows. Example 21–5 Configuring windowLength in the Buffering Output Adapter ... wlevs:adapter id=myHaSlidingWindowAdapter provider=ha-buffering wlevs:listener bean class=com.bea.wlevs.example.helloworld.HelloWorldBean wlevs:listener wlevs:instance-property name=windowLength value=0 wlevs:adapter ... For more information, see Section 21.2.2.1, Buffering Output Adapter EPN Assembly File Configuration . 7. Optionally, configure the component configuration file to include the Oracle CEP high availability buffering output adapter as Example 21–6 shows. Example 21–6 Simple Failover Component Configuration File With High Availability Adapters ?xml version=1.0 encoding=UTF-8? wlevs:config xmlns:wlevs=http:www.bea.comnswlevsconfigapplication xmlns:ha=http:www.oracle.comnscepconfigcluster processor namehelloworldProcessorname rules query id=helloworldRule [CDATA[ select from helloworldInputChannel [Now] ]] query Configuring High Availability 21-5 rules processor ha:ha-buffering-adapter namemyHaSlidingWindowAdaptername window-length0window-length ha:ha-buffering-adapter wlevs:config For more information, see: ■ Section 21.2.2.2, Buffering Output Adapter Component Configuration File Configuration 8. Deploy your application to the deployment group you created in step 1. For more information, see Section 24.5, Deploying Oracle CEP Applications . Oracle CEP automatically selects one of the Oracle CEP servers as the primary.

21.1.2 How to Configure Simple Failover With Buffering

You configure simple failover using the Oracle CEP buffering output adapter with a sliding window size greater than zero 0. This procedure starts with the example EPN that Figure 21–2 shows and adds the required components to configure it for simple failover with buffering. Example 21–7 shows the corresponding EPN assembly file and Example 21–8 shows the corresponding component configuration file. For more information about this Oracle CEP high availability quality of service, see Section 20.2.2, Simple Failover with Buffering . Figure 21–2 Simple Failover With Buffering EPN Example 21–7 Simple Failover With Buffering EPN Assembly File ?xml version=1.0 encoding=UTF-8? beans ... wlevs:event-type-repository wlevs:event-type type-name=HelloWorldEvent wlevs:classcom.bea.wlevs.event.example.helloworld.HelloWorldEventwlevs:class wlevs:event-type wlevs:event-type-repository wlevs:adapter id=helloworldAdapter class=com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter wlevs:instance-property name=message value=HelloWorld - the current time is: wlevs:adapter wlevs:channel id=helloworldInputChannel event-type=HelloWorldEvent wlevs:listener ref=helloworldProcessor wlevs:source ref=helloworldAdapter wlevs:channel wlevs:processor id=helloworldProcessor wlevs:channel id=helloworldOutputChannel 21-6 Oracle Complex Event Processing Developers Guide event-type=HelloWorldEvent advertise=true wlevs:listener bean class=com.bea.wlevs.example.helloworld.HelloWorldBean wlevs:listener wlevs:source ref=helloworldProcessor wlevs:channel beans Example 21–8 Simple Failover With Buffering Component Configuration Assembly File ?xml version=1.0 encoding=UTF-8? wlevs:config xmlns:wlevs=http:www.bea.comnswlevsconfigapplication xmlns:ha=http:www.oracle.comnscepconfigcluster processor namehelloworldProcessorname rules query id=helloworldRule [CDATA[ select from helloworldInputChannel [Now] ]] query rules processor wlevs:config To configure simple failover with buffering: 1. Create a multi-server domain using Oracle Coherence. For more information, see: ■ How to Create an Oracle CEP Multi-Server Domain With Default Groups Using Oracle Coherence in the Oracle Complex Event Processing Administrators Guide. ■ How to Create an Oracle CEP Multi-Server Domain With Custom Groups Using Oracle Coherence in the Oracle Complex Event Processing Administrators Guide. 2. Create an Oracle CEP application. For more information, see Section 4.2, Creating Oracle CEP Projects . 3. Edit the MANIFEST.MF file to add the following Import-Package entries: ■ com.bea.wlevs.ede.api.cluster ■ com.oracle.cep.cluster.hagroups ■ com.oracle.cep.cluster.ha.adapter ■ com.oracle.cep.cluster.ha.api For more information, see Section 4.7.2, How to Add an OSGi Bundle to an Oracle CEP Project . 4. Configure your Oracle CEP application EPN assembly file to add an Oracle CEP high availability buffering output adapter as Example 21–3 shows. ■ Add a wlevs:adapter element with provider set to ha-buffering after channel helloworldOutputChannel. ■ Update the wlevs:listener element in channel helloworldOutputChannel to reference the ha-buffering adapter by its id.