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

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. 23-18 Oracle Complex Event Processing Developers Guide Part VII Part VII Assembly, Deployment, and Testing Part VII contains the following chapters: ■ Chapter 24, Assembling and Deploying Oracle CEP Applications ■ Chapter 25, Testing Applications With the Load Generator and csvgen Adapter ■ Chapter 26, Testing Applications With the Event Inspector ■ Chapter 27, Performance Tuning 24 Assembling and Deploying Oracle CEP Applications 24-1 24 Assembling and Deploying Oracle CEP Applications This section contains information on the following subjects: ■ Section 24.1, Overview of Application Assembly and Deployment ■ Section 24.2, Assembling an Oracle CEP Application ■ Section 24.3, Managing Application Libraries ■ Section 24.4, Managing Log Message Catalogs ■ Section 24.5, Deploying Oracle CEP Applications

24.1 Overview of Application Assembly and Deployment

The term application assembly refers to the process of packaging the components of an application, such as the Java files and XML configuration files, into an OSGI bundle that can be deployed to Oracle CEP. The term application deployment refers to the process of making an application available for processing client requests in an Oracle CEP domain. This section describes: ■ Section 24.1.1, Applications ■ Section 24.1.3, Application Libraries ■ Section 24.1.2, Application Dependencies ■ Section 24.1.4, Deployment and Deployment Order ■ Section 24.1.5, Configuration History Management

24.1.1 Applications

In the context of Oracle CEP assembly and deployment, an application is defined as an OSGi bundle see http:www2.osgi.orgjavadocr4orgosgiframeworkBundle.html JAR file that contains the following artifacts: Note: Oracle CEP applications are built on top of the Spring Framework and OSGi Service Platform and make extensive use of their technologies and services. See Appendix A, Additional Information about Spring and OSGi, for links to reference and conceptual information about Spring and OSGi. 24-2 Oracle Complex Event Processing Developers Guide ■ The compiled Java class files that implement some of the components of the application, such as the adapters, adapter factory, and POJO that contains the business logic. ■ One or more Oracle CEP configuration XML files that configure the components of the application. The only type of component that is required to have a configuration file is the complex event processor; all other components adapters and streams do not require configuration files if the default configuration of the component is adequate. You can combine all configuration files into a single file, or separate the configuration for individual components in their own files. The configuration files must be located in the META-INFwlevs directory of the OSGi bundle JAR file if you plan to dynamically deploy the bundle. If you have an application already present in the domain directory, then the configuration files need to be extracted in the same directory. ■ An EPN assembly file that describes all the components of the application and how they are connected to each other. The EPN assembly file must be located in the META-INFspring directory of the OSGi bundle JAR file. ■ A MANIFEST.MF file that describes the contents of the JAR.

24.1.2 Application Dependencies

The OSGI bundle declares dependencies by specifying imported and required packages. It also provides functionality to other bundles by exporting packages. If a bundle is required to provide functionality to other bundles, you must use Export-Package to allow other bundles to reference named packages. All packages not exported are not available outside the bundle. You define dependencies at design time. This section describes: ■ Section 24.1.2.1, Private Application Dependencies ■ Section 24.1.2.2, Shared Application Dependencies ■ Section 24.1.2.3, Native Code Dependencies For more information, see: ■ Section 24.1.4, Deployment and Deployment Order ■ Section 24.2, Assembling an Oracle CEP Application

24.1.2.1 Private Application Dependencies

Some dependencies are satisfied by a component bundled in and deployed with an application. For example, standard JAR files or property files. For more information, see: ■ Section 4.7.1, How to Add a Standard JAR File to an Oracle CEP Project ■ Section 4.7.2, How to Add an OSGi Bundle to an Oracle CEP Project ■ Section 4.7.3, How to Add a Property File to an Oracle CEP Project

24.1.2.2 Shared Application Dependencies

Some dependencies are satisfied by a component deployed to the Oracle CEP server application library directory. These components are not bundled in and deployed with Assembling and Deploying Oracle CEP Applications 24-3 a specific application. Instead, they are accessible to any application that imports one or more of the packages that th eapplication library exports. For more information, see: ■ Section 24.1.2.3, Native Code Dependencies ■ Section 24.1.3, Application Libraries ■ Section 4.7.4, How to Export a Package ■ Section 4.7.5, How to Import a Package

24.1.2.3 Native Code Dependencies

In some cases, you may create an application library that depends on native code libraries that you cannot or may not choose to package as application libraries. In this case, you can put native code libraries in the operating system path bootclasspath of the Oracle CEP server when it is started, so that the native code libraries can be loaded by library bundles that need to call this native code. For more information, see: ■ Section 24.1.2.2, Shared Application Dependencies ■ Configuring the Oracle CEP Server Boot Classpath in the Oracle Complex Event Processing Administrators Guide

24.1.3 Application Libraries

The Oracle CEP application library gives you a convenient location to deploy shared libraries and gives you complete control over the order in which shared libraries are deployed at Oracle CEP server start up time. An application library is an OSGi bundle that contains a Java archive JAR of compiled Java classes and any other required artifacts. You can use application libraries for a variety of purposes such as drivers or foreign stages partial or complete Oracle CEP applications that are useful to other downstream applications. Although you can add a library to a project as a simple embedded JAR file, there are advantages to using an application library, including: ■ Simplifying application assembly and maintenance activities such as deploying an updated version of the library. ■ Encouraging re-use. ■ Reducing server disk space consumption. You deploy application libraries to either of the following Oracle CEP server directories: ■ Section 24.1.3.1, Library Directory ■ Section 24.1.3.2, Library Extensions Directory ■ Section 24.1.3.3, Creating Application Libraries For more information, see: ■ Section 24.3, Managing Application Libraries ■ Section 24.1.2, Application Dependencies 24-4 Oracle Complex Event Processing Developers Guide ■ Section 24.1.4, Deployment and Deployment Order ■ Section 1.1.1.9, Foreign Stages ■ Appendix A, Additional Information about Spring and OSGi

24.1.3.1 Library Directory

By default, the Oracle CEP server library directory is: DOMAIN_DIR servernamemodules Where: ■ DOMAIN_DIR : is the the domain directory such as oracle_cepuser_ projectsdomainsmydomain. ■ servername : is the server instance, such as myserver. For example: oracle_cepuser_projectsdomainsmydomainmyservermodules The libraries in this directory are deployed after the components in the library extensions directory but before any Oracle CEP applications. If your library is a driver such as a JDBC driver, you must put it in the library extensions directory as Section 24.1.3.2, Library Extensions Directory describes. To configure the root of the application library directory path, see Section 24.3.1, How to Define the Application Library Directory Using Oracle CEP IDE for Eclipse .

24.1.3.2 Library Extensions Directory

By default, the Oracle CEP server library extensions directory is: DOMAIN_DIR servernamemodulesext Where: ■ DOMAIN_DIR : is the the domain directory such as oracle_cepuser_ projectsdomainsmydomain. ■ servername : is the server instance, such as myserver. For example: oracle_cepuser_projectsdomainsmydomainmyservermodulesext The libraries in this directory are deployed first along with the Oracle CEP server core modules. If your library is a driver such as a JDBC driver, you must put it in the library extensions directory so that it is activated in the correct order. For example, to override an older version with a newer version or to provide access to an alternative driver. For more information, see Configuring Access to a Different Database Driver or Driver Version in the Oracle Complex Event Processing Administrators Guide. If your library is not a driver, you may put it in the library directory as Section 24.1.3.1, Library Directory describes. To configure the root of the application library extensions directory path, see Section 24.3.1, How to Define the Application Library Directory Using Oracle CEP IDE for Eclipse .