How to Configure Scalability in a JMS Application Without Oracle CEP High Availability

Configuring Scalability 23-15 Example 23–8 ActiveActiveGroupBean bean Element bean id=clusterAdapter class=com.oracle.cep.cluster.hagroups.ActiveActiveGroupBean bean 5. Edit the component configuration file to configure a jms-adapter element for the inbound JMS adapters as Example 23–9 shows: ■ Each in-bound JMS adapter must listen to a different topic. ■ Set session-transacted to true. Example 23–9 jms-adapter Element for Inbound JMS Adapters ?xml version=1.0 encoding=UTF-8? wlevs:config xmlns:wlevs=http:www.bea.comnswlevsconfigapplication xmlns:ha=http:www.oracle.comnscepconfigcluster ... jms-adapter nameJMSInboundAdaptername event-typeStockTickevent-type jndi-provider-urlt3:ppurich-pc:7001jndi-provider-url destination-jndi-name.Topic1destination-jndi-name session-transactedtruesession-transacted ... jms-adapter jms-adapter nameJMSInboundAdapter2name event-typeStockTickevent-type jndi-provider-urlt3:ppurich-pc:7001jndi-provider-url destination-jndi-name.Topic2destination-jndi-name session-transactedtruesession-transacted ... jms-adapter wlevs:config For more information, see Chapter 7, Configuring JMS Adapters . 6. Define a parameterized message-selector in the jms-adapter element for each JMS inbound adapter. Edit the component configuration file to add group-binding child elements to the jms-adapter element for the JMS inbound adapters. Add one group-binding element for each possible JMS message-selector value as Example 23–10 shows. Example 23–10 jms-adapter Selector Definition for ocep-server-1 jms-adapter nameJMSInboundAdaptername event-typeStockTickevent-type jndi-provider-urlt3:ppurich-pc:7001jndi-provider-url destination-jndi-name.Topic1destination-jndi-name session-transactedtruesession-transacted message-selector{CONDITION}message-selector bindings group-binding group-id=ActiveActiveGroupBean_group1 param id=CONDITIONacctid = 1000param group-binding group-binding group-id=ActiveActiveGroupBean_group2 param id=CONDITIONacctid 1000param group-binding bindings jms-adapter 23-16 Oracle Complex Event Processing Developers Guide In this configuration, when the application is deployed to an Oracle CEP server with a cluster element groups child element that contains ActiveActiveGroupBean_group1, then the CONDITION parameter is defined as acctid = 1000 and the application processes events whose acctid property is less than or equal to 1000. Similarily, when the application is deployed to an Oracle CEP server with a cluster element groups child element that contains ActiveActiveGroupBean_group2, then the CONDITION parameter is defined as acctid 1000 and the application processes events whose acctid property is greater than 1000. 7. Edit the component configuration file to configure a jms-adapter element for the outbound JMS adapter as Example 23–11 shows: ■ Configure the out-bound JMS adapter with the same topic as the correlating in-bound adapter in this example, JMSInboundAdapter2: .Topic2. ■ Set session-transacted to true. Example 23–11 jms-adapter Element for Outbound JMS Adapters ?xml version=1.0 encoding=UTF-8? wlevs:config xmlns:wlevs=http:www.bea.comnswlevsconfigapplication xmlns:ha=http:www.oracle.comnscepconfigcluster ... jms-adapter nameJMSInboundAdaptername event-typeStockTickevent-type jndi-provider-urlt3:ppurich-pc:7001jndi-provider-url destination-jndi-name.Topic1destination-jndi-name session-transactedtruesession-transacted ... jms-adapter jms-adapter nameJMSInboundAdapter2name event-typeStockTickevent-type jndi-provider-urlt3:ppurich-pc:7001jndi-provider-url destination-jndi-name.Topic2destination-jndi-name session-transactedtruesession-transacted ... jms-adapter jms-adapter nameJMSOutboundAdaptername event-typeStockTickevent-type jndi-provider-urlt3:ppurich-pc:7001jndi-provider-url destination-jndi-name.Topic2destination-jndi-name session-transactedtruesession-transacted ... jms-adapter wlevs:config For more information, see Chapter 7, Configuring JMS Adapters . 8. Deploy your application to the deployment group of your multi-server domain. For more information, see Chapter 24, Assembling and Deploying Oracle CEP Applications . At runtime, each Oracle CEP server configures its instance of the application with the message-selector that corresponds to its ActiveActiveGroupBean notification group. This partitions the JMS topic so that each instance of the application processes a subset of the total number of messages in parallel. If the active Oracle CEP server in an ActiveActiveGroupBean group goes down, the Oracle CEP server performs an Oracle CEP high availability failover to the standby Oracle CEP server in that ActiveActiveGroupBean group. Configuring Scalability 23-17

23.2.3 How to Configure the ActiveActiveGroupBean Group Pattern Match

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 group pattern to specify a different notification group naming pattern. How to configure the ActiveActiveGroupBean group pattern match: 1. Configure the EPN assembly file to add a groupPattern attribute to your ActiveActiveGroupBean element as Example 23–12 shows. Example 23–12 ActiveActiveGroupBean bean Element With groupPattern Attribute bean id=clusterAdapter class=com.oracle.cep.cluster.hagroups.ActiveActiveGroupBean property name=groupPattern value=MyNotificationGroupPattern bean 2. Specify a value for the groupPattern attribute that matches the cluster group naming convention you want to use for notification groups.