Correlating Output Adapter Component Configuration File Configuration

22-4 Oracle Complex Event Processing Developers Guide For more information, Section 9.1.6, Batch Processing Channels .

22.2.2 ActiveActiveGroupBean

Using the com.oracle.cep.cluster.hagroups.ActiveActiveGroupBean, you can partition an incoming JMS stream in Oracle CEP applications by utilizing the notification groups that the ActiveActiveGroupBean creates. You add an ActiveActiveGroupBean to your EPN assembly file as Example 22–1 shows. Example 22–1 ActiveActiveGroupBean bean Element bean id=clusterAdapter class=com.oracle.cep.cluster.hagroups.ActiveActiveGroupBean bean By default, the ActiveActiveGroupBean creates notification groups named: ActiveActiveGroupBean_X Where X is a string. At runtime, the ActiveActiveGroupBean scans the existing groups defined on the Oracle CEP server and applies a default pattern match of: ActiveActiveGroupBean_\\w+ When it finds a match, it creates a notification group of that name. Optionally, you can define your own cluster group pattern match as Section 23.2.3, How to Configure the ActiveActiveGroupBean Group Pattern Match describes. This section describes: ■ Section 22.2.2.1, Scalability in an Oracle CEP Application Using the ActiveActiveGroupBean Without High Availability ■ Section 22.2.2.2, Scalability in an Oracle CEP Application Using the ActiveActiveGroupBean With High Availability For more information, see: ■ Section 20.1.2, Deployment Group and Notification Group ■ Section 23.2, Configuring Scalability With the ActiveActiveGroupBean 22.2.2.1 Scalability in an Oracle CEP Application Using the ActiveActiveGroupBean Without High Availability You can use the ActiveActiveGroupBean to partition an incoming JMS event stream by selector in an Oracle CEP application that is not configured for high availability. Consider the multi-server domain that Figure 22–2 shows. Understanding Scalability 22-5 Figure 22–2 Oracle CEP ActiveActiveGroupBean Without High Availability In this scalability scenario, you define a cluster group in the Oracle CEP server config.xml on each server ActiveActiveGroupBean_group1 on Host 1, ActiveActiveGroupBean_group2 on Host 2, and so on and add an instance of the ActiveActiveGroupBean to your Oracle CEP application to define notification groups based on these cluster groups. Each notification group is bound to a different JMS selector. The component configuration file in your Oracle CEP application contains the same jms-adapter configuration as Example 22–2 shows. Example 22–2 Common jms-adapter Selector Definitions jms-adapter message-selector{CONDITION}message-selector bindings group-binding group-id=ActiveActiveGroupBean_group1 param id=CONDITIONacctid 400param group-binding group-binding group-id=ActiveActiveGroupBean_group2 param id=CONDITIONacctid BETWEEN 301 AND 400param group-binding group-binding group-id=ActiveActiveGroupBean_group3 param id=CONDITIONacctid BETWEEN 201 AND 300param group-binding group-binding group-id=ActiveActiveGroupBean_group4 param id=CONDITIONacctid = 200param group-binding bindings jms-adapter At runtime, the ActiveActiveGroupBean instance in each Oracle CEP application instance on each Oracle CEP server finds its ActiveActiveGroupBean_ cluster group and creates a notification group based on it. The Oracle CEP application then configures itself with the message-selector that corresponds to the group-id that 22-6 Oracle Complex Event Processing Developers Guide matches that notification group. This partitions the JMS topic so that each instance of App1 processes a subset of the total number of messages in parallel. For more information, see Section 23.2.1, How to Configure Scalability in a JMS Application Without Oracle CEP High Availability . 22.2.2.2 Scalability in an Oracle CEP Application Using the ActiveActiveGroupBean With High Availability In addition to partitioning an incoming JMS event stream by selector, you can also use the ActiveActiveGroupBean to configure two or more Oracle CEP servers to function as a single, high availability unit. Consider the multi-server domain with an Oracle CEP high availability application deployed to it that Figure 22–3 shows. Figure 22–3 Oracle CEP ActiveActiveGroupBean With High Availability In this scenario, you create the same ActiveActiveGroupBean_ cluster group on Host 1 and Host 2 ActiveActiveGroupBean_group1 and the same ActiveActiveGroupBean_ cluster group on Host 3 and Host 4 ActiveActiveGroupBean_group2. At runtime, the ActiveActiveGroupBean instance in each Oracle CEP application instance on each Oracle CEP server finds its ActiveActiveGroupBean_ cluster group and creates a notification group based on it. Both Host 1 and Host 2 belong to one notification group ActiveActiveGroupBean_group1 and both Host 3 and Host 4 belong to another notification group ActiveActiveGroupBean_group2 . Note: Within each instance of App1, you could further increase parallel processing by configuring an event partitioner channel as Section 22.2.1, EventPartitioner describes. Understanding Scalability 22-7 Each Oracle CEP application then configures itself with the message-selector that corresponds to the group-id that matches that notification group. This partitions the JMS topic so that each instance of App1 processes a subset of the total number of messages in parallel. When more than one Oracle CEP server belongs to the same notification group, the ActiveActiveGroupBean ensures that only the primary server in each notification group outputs events. Within a given notification group, should the primary server go down, then an Oracle CEP high availability fail over occurs and one of the secondary servers in that notification group is declared the new primary and resumes outputting events according to the Oracle CEP high availability quality of service you configure. For more information, see Section 23.2.2, How to Configure Scalability in a JMS Application With Oracle CEP High Availability . Note: Within each instance of App1, you could further increase parallel processing by configuring an event partitioner channel as Section 22.2.1, EventPartitioner describes.