When to Use a Channel

Configuring Channels 9-5 Figure 9–1 shows an EPN with channel filteredStream connected to up-stream Oracle CQL processor filteredFanoutProcessor. Figure 9–1 EPN With Oracle CQL Processor and Down-Stream Channel Example 9–5 shows the queries configured for the Oracle CQL processor. Example 9–5 filterFanoutProcessor Oracle CQL Queries processor namefilterFanoutProcessorname rules query id=Yr3Sector[CDATA[ select cusip, bid, srcId, bidQty, ask, askQty, seq from priceStream where sector=3_YEAR ]]query query id=Yr2Sector[CDATA[ select cusip, bid, srcId, bidQty, ask, askQty, seq from priceStream where sector=2_YEAR ]]query query id=Yr1Sector[CDATA[ select cusip, bid, srcId, bidQty, ask, askQty, seq from priceStream where sector=1_YEAR ]]query rules processor If you specify more than one query for an Oracle CQL processor as Example 9–5 shows, then, by default, all query results are output to the processor’s out-bound channel filteredStream in Figure 9–1 . Optionally, in the component configuration source, you can use the channel element selector child element to specify a space-delimited list of one or more Oracle CQL query names that may output their results to the channel as Example 9–6 shows. In this example, query results for query Yr3Sector and Yr2Sector are output to filteredStream but not query results for query Yr1Sector. Example 9–6 Using selector to Control Which Query Results are Output channel namefilteredStreamname selectorYr3Sector Yr2Sectorselector channel You may configure a channel element with a selector before creating the queries in the upstream processor. In this case, you must specify query names that match the names in the selector. For more information, see Appendix D.78, selector . Note: The selector child element is only applicable if the up-stream node is an Oracle CQL processor. For more information, see Chapter 10, Configuring Oracle CQL Processors . 9-6 Oracle Complex Event Processing Developers Guide

9.1.6 Batch Processing Channels

By default, a channel processes events as they arrive. Alternatively, you can configure a channel to batch events together that have the same timestamp and were output from the same query by setting the wlevs:channel attribute batching to true as Example 9–7 shows. Example 9–7 Batch Processing Channel ... wlevs:channel id=priceStream event-type=PriceEvent batching=true wlevs:listener ref=filterFanoutProcessor wlevs:source ref=PriceAdapter wlevs:channel ... For more information, see: ■ Section 1.1.3.2, Stream and Relation Sources ■ Section 1.1.3.3, Stream and Relation Sinks ■ batching in Table C–9, Attributes of the wlevs:channel Application Assembly Element

9.1.7 EventPartitioner Channels

By default, a channel broadcasts each event to every listener. When you configure a channel to use an EventPartitioner, each time an incoming event arrives, the channel selects a listener and dispatches the event to that listener instead of broadcasting each event to every listener. You can use an EventPartitioner on a channel to improve scalability. For more information, see Section 22.2.1, EventPartitioner .

9.2 Configuring a Channel

You can configure a channel manually or by using the Oracle CEP IDE for Eclipse. See Section B.2, Component Configuration Schema wlevs_application_config.xsd for the complete XSD Schema that describes the channel component configuration file. See Section 9.3, Example Channel Configuration Files for a complete example of a channel configuration file. This section describes the following topics: ■ Section 9.2.1, How to Configure a System-Timestamped Channel Using Oracle CEP IDE for Eclipse ■ Section 9.2.2, How to Configure an Application-Timestamped Channel Using Oracle CEP IDE for Eclipse ■ Section 9.2.3, How to Create a Channel Component Configuration File Manually

9.2.1 How to Configure a System-Timestamped Channel Using Oracle CEP IDE for Eclipse

This section describes how to create a system-timestamped channel.