HTTP Pub-Sub Adapter for Publising EPN Assembly File Configuration

Configuring HTTP Publish-Subscribe Server Adapters 8-13 http:www.bea.comnswlevsspringspring-wlevs.xsd wlevs:event-type-repository wlevs:event-type type-name=com.mycompany.httppubsub.PubsubEvent wlevs:classcom.mycompany.httppubsub.PubsubEventwlevs:class wlevs:event-type wlevs:event-type-repository wlevs:adapter id=remoteSubscriber provider=httpsub wlevs:listener ref=myEventBean wlevs:adapter bean id=myEventBean class=com.mycompany.httppubsub.MyEventBean bean wlevs:channel id=pubsubStream advertise=true wlevs:listener bean id=mySink class=com.mycompany.httppubsub.MySink wlevs:listener wlevs:source ref=myEventBean wlevs:channel beans

8.5 Configuring the HTTP Pub-Sub Adapter Component Configuration File

You configure the HTTP pub-sub adapters in their respective configuration files, similar to how you configure other components in the event processing network, such as processors or streams. The root element for configuring an HTTP pub-sub adapter is http-pub-sub-adapter. The name child element for a particular adapter must match the id attribute of the corresponding wlevs:adapter element in the EPN assembly file that declares this adapter. This section describes: ■ Section 8.5.1, HTTP Pub-Sub Adapter for Publising Component Configuration ■ Section 8.5.2, HTTP Pub-Sub Adapter for Subscribing Component Configuration For more information, see: ■ Section 1.1.5, Component Configuration Files. ■ Section B.2, Component Configuration Schema wlevs_application_config.xsd

8.5.1 HTTP Pub-Sub Adapter for Publising Component Configuration

Table 8–1 lists the http-pub-sub-adapter element child elments applicable to an HTTP pub-sub adapter for publishing. Table 8–1 http-pub-sub-adapter for Publishing Component Configuration Child Elements Child Element Description server-context-path Required. For each local HTTP pub-sub adapter for publishing, specify the value of the Oracle CEP server config.xml file element http-pubsub child element path of the local HTTP pub-sub server associated with the Oracle CEP instance hosting the current Oracle CEP application. Default: pubsub. If you have created a new local HTTP pub-sub server, or changed the default configuration, then specify the appropriate path child element value. NOTE: Do not specify this option for a remote HTTP pub-sub adapter. 8-14 Oracle Complex Event Processing Developers Guide The following configuration file shows a complete example of configuring an HTTP pub-sub adapter for publishing: both a remote and local publisher is shown. ?xml version=1.0 encoding=UTF-8? n1:config xsi:schemaLocation=http:www.bea.comnswlevsconfigapplication wlevs_application_ config.xsd xmlns:n1=http:www.bea.comnswlevsconfigapplication xmlns:xsi=http:www.w3.org2001XMLSchema-instance http-pub-sub-adapter nameremotePublishername server-urlhttp:myhost.com:9102pubsubserver-url channelchannel1channel event-typecom.mycompany.httppubsub.PubsubEventevent-type userwlevsuser passwordwlevspassword http-pub-sub-adapter http-pub-sub-adapter namelocalPublishername server-context-pathpubsubserver-context-path channelchannel2channel http-pub-sub-adapter http-pub-sub-adapter nameremoteSubscribername server-urlhttp:myhost.com:9102pubsubserver-url channelchannel3channel event-typecom.mycompany.httppubsub.PubsubEventevent-type http-pub-sub-adapter server-url Required. For each remote HTTP pub-sub adapter for publishing, specify the URL of the remote HTTP pub-sub server to which the Oracle CEP application will publish. The remote HTTP 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:myhost.com:9102pubsub NOTE: Do not specify this option for a local HTTP pub-sub adapter. channel Required. For both local and remote HTTP pub-sub adapters for publishing, specify the channel that the HTPP pub-sub adapter publishes to. event-type Optional. For both local and remote HTTP pub-sub adapters for publishing, specify the fully qualified class name of the JavaBean event to limit the types of events that are published. Otherwise, all events sent to the HTTP pub-sub adapter are published. You must register this class in the EPN assembly file as a wlevs:event-type-repository element wlevs:class child element. For more information, see Section 2.2, Creating an Oracle CEP Event Type as a JavaBean . user Optional. For both local and remote HTTP pub-sub adapters for publishing, if the HTTP pub-sub server to which the Oracle CEP application is publishing requires user authentication, specify a user name. password Optional. For both local and remote HTTP pub-sub adapters for publishing, if the HTTP pub-sub server to which the Oracle CEP application is publishing requires user authentication, specify a password. Choose either password or encrypted-password but not both. encrypted-password Optional. For both local and remote HTTP pub-sub adapters for publishing, if the HTTP pub-sub server to which the Oracle CEP application is publishing requires user authentication and requires password encryption, specify an encrypted password. Choose either password or encrypted-password but not both. Table 8–1 Cont. http-pub-sub-adapter for Publishing Component Configuration Child Elements Child Element Description Configuring HTTP Publish-Subscribe Server Adapters 8-15 n1:config

8.5.2 HTTP Pub-Sub Adapter for Subscribing Component Configuration

Table 8–2 lists the http-pub-sub-adapter element child elments applicable to an HTTP pub-sub adapter for subscribing. The following configuration file shows a complete example of configuring an HTTP pub-sub adapter for subscribing. ?xml version=1.0 encoding=UTF-8? n1:config xsi:schemaLocation=http:www.bea.comnswlevsconfigapplication wlevs_application_ config.xsd xmlns:n1=http:www.bea.comnswlevsconfigapplication xmlns:xsi=http:www.w3.org2001XMLSchema-instance http-pub-sub-adapter nameremotePublishername server-urlhttp:myhost.com:9102pubsubserver-url channelchannel1channel event-typecom.mycompany.httppubsub.PubsubEventevent-type userwlevsuser passwordwlevspassword http-pub-sub-adapter http-pub-sub-adapter namelocalPublishername server-context-pathpubsubserver-context-path channelchannel2channel Table 8–2 http-pub-sub-adapter for Subscribing Component Configuration Child Elements Child Element Description server-url Required. For each remote HTTP pub-sub adapter for subscribing, specify the URL of the remote HTTP pub-sub server to which the Oracle CEP application will publish. The remote HTTP 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 NOTE: do not specify this option for a local HTTP pub-sub adapter. channel Required. For both local and remote HTTP pub-sub adapters for subscribing, specify the channel that the HTPP pub-sub adapter subscribes to. event-type Required. For both local and remote HTTP pub-sub adapters for subscribing, specify the fully qualified class name of the JavaBean to which incoming messages are mapped. At runtime, Oracle CEP uses the incoming key-value pairs in the message to map the message data to the specified event type. You must register this class in the EPN assembly file as a wlevs:event-type-repository element wlevs:class child element. For more information, see Section 2.2, Creating an Oracle CEP Event Type as a JavaBean . user Optional. For both local and remote HTTP pub-sub adapters for subscribing, if the HTTP pub-sub server to which the Oracle CEP application is publishing requires user authentication, specify a user name. password Optional. For both local and remote HTTP pub-sub adapters for subscribing, if the HTTP pub-sub server to which the Oracle CEP application is publishing requires user authentication, specify a password. Choose either password or encrypted-password but not both. encrypted-password Optional. For both local and remote HTTP pub-sub adapters for subscribing, if the HTTP pub-sub server to which the Oracle CEP application is publishing requires user authentication and requires password encryption, specify an encrypted password. Choose either password or encrypted-password but not both.