Overview of the Built-In Pub-Sub Adapter for Subscribing

Configuring HTTP Publish-Subscribe Server Adapters 8-7 namelocalPublishername ... http-pub-sub-adapter n1:config 3. For each remote pub-sub adapter for both publishing and subscribing, add a server-url child element of http-pub-sub-adapter to specify the URL of the remote HTTP pub-sub server to which the Oracle CEP application will publish or subscribe, respectively. The remote pub-sub server could be another instance of Oracle CEP, or a WebLogic Server instance, or it could be any third-party HTTP pub-sub server. For example: http-pub-sub-adapter nameremotePublishername server-urlhttp:myhost.com:9102pubsubserver-url ... http-pub-sub-adapter In the example, the URL of the remote HTTP pub-sub server to which the remotePublisher adapter will publish events is http:myhost.com:9102pubsub. 4. For each local pub-sub adapter for publishing, add a server-context-path element to specify the path of the local HTTP pub-sub server associated with the Oracle CEP instance hosting the current Oracle CEP application. By default, each Oracle CEP server is configured with an HTTP pub-sub server with path pubsub; if, however, you have created a new local HTTP pub-sub server, or changed the default configuration, then specify the value of the path child element of the http-pubsub element in the servers config.xml file. For example: http-pub-sub-adapter namelocalPublishername server-context-pathpubsubserver-context-path ... http-pub-sub-adapter 5. For all the pub-sub adapters, whether they are local or remote or for publishing or subscribing, add a channel child element to specify the channel that the pub-sub adapter publishes or subscribes to, whichever is appropriate. For example: http-pub-sub-adapter namelocalPublishername server-context-pathpubsubserver-context-path channelchannel2channel http-pub-sub-adapter In the example, the localPublisher pub-sub adapter publishes to a local channel with pattern channel2. 6. For all pub-sub adapters for subscribing, add an event-type element that specifies the JavaBean to which incoming messages are mapped. You are required to specify this for all subscribing adapters. At runtime, Oracle CEP uses the incoming key-value pairs in the message to map the message data to the specified event type. You can also optionally use the event-type element in a pub-sub adapter for publishing if you want to limit the types of events that are published to just those specified by the event-type elements. Otherwise, all events sent to the pub-sub adapter are published. For example: 8-8 Oracle Complex Event Processing Developers Guide http-pub-sub-adapter nameremoteSubscribername server-urlhttp:myhost.com:9102pubsubserver-url channelchannel3channel event-typecom.mycompany.httppubsub.PubsubEventevent-type http-pub-sub-adapter Be sure this event type has been registered in the EPN assembly file by specifying it as a child element of the wlevs:event-type-repository element. 7. Finally, if the HTTP pub-sub server to which the Oracle CEP application is publishing requires user authentication, add user and password or encrypted-password elements to specify the username and password or encrypted password. For example: http-pub-sub-adapter nameremotePublishername server-urlhttp:myhost.com:9102pubsubserver-url channelchannel1channel event-typecom.mycompany.httppubsub.PubsubEventevent-type userwlevsuser passwordwlevspassword http-pub-sub-adapter 8. Optionally create a converter Java class if you want to customize the way the inbound or outbound messages are converted into event types. This step is optional because you can let Oracle CEP make the conversion based on mapping property names between the messages and a specified event type. See Section 8.3, Creating a Custom Converter Between the HTTP Pub-Sub Messages and Event Types. 9. If you are going to use the local HTTP pub-sub server associated with the Oracle CEP instance for local publishing, use Visualizer, the Oracle CEP Administration Tool, to add new channels with the channel pattern required by your application. For details, see How to Configure Security for an HTTP Publish-Subscribe Channel in the Oracle Complex Event Processing Visualizer Users Guide. 10. Update the EPN assembly file, adding declarations for each built-in pub-sub adapter you are adding to your application. See Section 8.4, Configuring the HTTP Pub-Sub Adapter EPN Assembly File. 11. Update the MANIFEST.MF file of your application, adding the package com.bea.core.encryption to the Import-Package header. For example: Import-Package: com.bea.core.encryption com.bea.wlevs.adapter.defaultprovider;version=11.1.1.4_0, ... See Section 24.2.2.1, Creating the MANIFEST.MF File for additional information on the manifest file.

8.3 Creating a Custom Converter Between the HTTP Pub-Sub Messages and Event Types

If you want to customize the way a message either inbound via a HTTP pub-sub adapter for subscribing or outbound via an HTTP pub-sub adapter for publishing is converted to an event type, or vice versa, you must create your own converter bean.