This section contains information on the following subjects:
Your Oracle Complex Event Processing (or Oracle CEP for short ) application contains one or more stream components, or streams for short. The streams stream data between other types of components, such as between adapters and processors, and between processors and the business logic POJO.
Each stream in your application has a default configuration. In particular:
The default stream configuration is typically adequate for most applications. However, if you want to change this configuration, you must create an XML file that is deployed as part of the Oracle CEP application bundle. You can later update this configuration at runtime using the wlevs.Admin utility or manipulating the appropriate JMX Mbeans directly.
If your application has more than one stream, you can create separate XML files for each stream, or create a single XML file that contains the configuration for all streams, or even all components of your application (adapters, processors, and streams). Choose the method that best suits your development environment.
The following procedure describes the main steps to create the stream configuration file. For simplicity, it is assumed in the procedure that you are going to configure all components of an application in a single XML file
See XSD Schema Reference for Component Configuration Files for the complete XSD Schema that describes the stream configuration file.
.xml
extension.
The root element of the configuration file is <config>
, with namespace definitions shown in the next step.
<stream>
child element of <config>
. Uniquely identify each stream with the <name>
child element. This name must be the same as the value of the id
attribute in the <wlevs:stream>
tag of the EPN assembly file that defines the event processing network of your application. This is how Oracle CEP knows to which particular stream component in the EPN assembly file this stream configuration applies. See Creating the EPN Assembly File for details.For example, if your application has two streams, the configuration file might initially look like:
<?xml version="1.0" encoding="UTF-8"?>
<helloworld:config
xmlns:helloworld="http://www.bea.com/xml/ns/wlevs/example/helloworld">
<processor>
...
</processor>
<stream>
<name>firstStream</name>
...
</stream>
<stream>
<name>secondStream</name>
...
</stream>
</helloworld:config>
In the example, the configuration file includes two streams called firstStream
and secondStream
. This means that the EPN assembly file must include at least two stream registrations with the same identifiers:
<wlevs:streamid="firstStream" ...
>
...
</wlevs:stream>
<wlevs:streamid="secondStream"
...>
...
</wlevs:stream>
WARNING: | Identifiers and names in XML files are case sensitive, so be sure you specify the same case when referencing the component’s identifier in the EPN assembly file. |
<max-size>
child element of the <stream>
element to specify the maximum size of the stream. Zero-size streams synchronously pass-through events. Streams with non-zero size process events asynchronously, buffering events by the requested size. The default value is 1024 . <stream>
<name>firstStream</name><max-size>10000</size>
</stream>
<max-threads>
child element of the <stream>
element to specify the maximum number of threads that will be used to process events for this stream. Setting this value has no effect when <max-size>
is 0. The default value is 1. <stream>
<name>firstStream</name><max-threads>2</size>
</stream>
monitoring
Boolean attribute of the <stream>
element to enable or disable monitoring of the stream; by default monitoring is enabled. When monitoring is enabled, the stream gathers runtime statistics, such as the number of events inbound and outbound on it, and forwards this information to an Mbean:<streammonitoring="true"
><name>firstStream</name>
</stream>
...
To truly enable monitoring, you must have also enabled the manageability of the stream, otherwise setting the monitoring
attribute to true
has no effect. You enable manageability by setting the manageable
attribute of the corresponding component registration in the EPN assembly file to true
, as shown in bold in the following example:
<wlevs:streamid="firstStream"
manageable="true"
>
<wlevs:listener ref="helloworldProcessor"/>
<wlevs:source ref="helloworldAdapter"/>
</wlevs:stream>
The following sample XML file shows how to configure two streamss, firstStream
and secondStream
.
<?xml version="1.0" encoding="UTF-8"?>
<sample:config
xmlns:sample="http://www.bea.com/xml/ns/wlevs/example/sample">
<stream>
<name>firstStream</name>
<max-size>10</max-size>
</stream>
<stream>
<name>secondStream</name>
<max-threads>4</max-threads>
</stream>
</sample:config>