JMS Outbound Adapter Component Configuration

8 Configuring HTTP Publish-Subscribe Server Adapters 8-1 8 Configuring HTTP Publish-Subscribe Server Adapters This section contains information on the following subjects: ■ Section 8.1, Overview of HTTP Publish-Subscribe Server Adapter Configuration ■ Section 8.2, Configuring an HTTP Pub-Sub Adapter ■ Section 8.4, Configuring the HTTP Pub-Sub Adapter EPN Assembly File ■ Section 8.5, Configuring the HTTP Pub-Sub Adapter Component Configuration File

8.1 Overview of HTTP Publish-Subscribe Server Adapter Configuration

An HTTP Publish-Subscribe server pub-sub server is a mechanism whereby Web clients, such as browser-based clients, subscribe to channels, receive messages as they become available, and publish messages to these channels, all using asynchronous messages over HTTP. A channel is similar to a JMS topic. Every instance of Oracle CEP includes a pub-sub server that programmers can use to implement HTTP publish-subscribe functionality in their applications. The pub-sub server is configured in the config.xml file along with other server services such as Jetty and JDBC datasources. The pub-sub server is based on the Bayeux protocol see http:svn.xantus.orgshortbustrunkbayeuxbayeux.html proposed by the cometd project see http:cometd.com . The Bayeux protocol defines a contract between the client and the server for communicating with asynchronous messages over HTTP. In Oracle CEP, programmers access HTTP publish-subscribe functionality by using the following built-in HTTP publish-subscribe adapters pub-sub adapters: ■ Publishing to a channel: see Section 8.1.1, Overview of the Built-In Pub-Sub Adapter for Publishing – Local publishing to a channel: see Section 8.1.1.1, Local Publishing . – Remote publishing to a channel: see Section 8.1.1.2, Remote Publishing . ■ Subscribing to a channel: see Section 8.1.2, Overview of the Built-In Pub-Sub Adapter for Subscribing . Oracle CEP also provides a pub-sub API for programmers to create their own custom pub-sub adapters for publishing and subscribing to a channel, if the built-in pub-sub adapters are not adequate. For example, programmers might want to filter incoming messages from a subscribed channel, dynamically create or destroy local channels, and so on. The built-in pub-sub adapters do not provide this functionality, which is why 8-2 Oracle Complex Event Processing Developers Guide programmers must implement their own custom pub-sub adapters in this case. For details, see Chapter 14, Configuring Custom Adapters. By default, Oracle CEP performs automatic conversion to and from Oracle CEP event types. Alternatively, you can create a custom converter. See Section 8.3, Creating a Custom Converter Between the HTTP Pub-Sub Messages and Event Types . Oracle CEP can also automatically convert between JSON messages and Oracle CEP event types. See Section 8.1.3, Converting Between JSON Messages and Event Types . The built-in pub-sub adapters work like any other adapter: they are stages in the event processing network, they are defined in the EPN assembly file, and they are configured with the standard component configuration files. Typical configuration options include specifying channels, specifying the local or remote pub-sub server, and user authentication. The pub-sub server can communicate with any client that can understand the Bayeux protocol. Programmers developer their Web clients using one of the following frameworks: ■ Dojo JavaScript library see http:dojotoolkit.org that supports the Bayeux protocol. Oracle CEP does not provide this library. ■ WebLogic Workshop Flex plug-in that enables development of a Flex client that uses the Bayeux protocol to communicate with a pub-sub server. For information on securing an HTTP pub-sub server channel, see Configuring HTTP Publish-Subscribe Server Channel Security in the Oracle Complex Event Processing Administrators Guide.

8.1.1 Overview of the Built-In Pub-Sub Adapter for Publishing

You can use the built-in pub-sub adapter for publishing events to a channel. The built-in pub-sub adapter supports the following publishing modes: ■ Section 8.1.1.1, Local Publishing ■ Section 8.1.1.2, Remote Publishing For more information, see Section 8.1, Overview of HTTP Publish-Subscribe Server Adapter Configuration .

8.1.1.1 Local Publishing

Figure 8–1 shows how the built-in pub-sub adapter for local publishing fits into a simple event processing network. The arbitrary adapter and processor are not required, they are just an example of possible components in your application in addition to the pub-sub adapter. Configuring HTTP Publish-Subscribe Server Adapters 8-3 Figure 8–1 Built-In Pub-Sub Adapter For Local Publishing Note the following in Figure 8–1 : ■ Events flow from some source into an adapter of an application running in Oracle CEP. This adapter is not required, it is shown only as an example. ■ The events flow from the adapter to an arbitrary processor; again, this processor is not required. ■ The processor sends the events to the built-in pub-sub adapter for local publishing. The adapter in turn sends the events to the local HTTP pub-sub server configured for the Oracle CEP instance on which the application is deployed. The pub-sub adapter sends the messages to the channel for which it has been configured. ■ The local HTTP pub-sub server configured for Oracle CEP then sends the event as a message to all subscribers of the local channel.

8.1.1.2 Remote Publishing

Figure 8–2 shows how the built-in pub-sub adapter for remote publishing fits into a simple event processing network. Figure 8–2 Built-In Pub-Sub Adapter For Remote Publishing Note the following in Figure 8–2 : 8-4 Oracle Complex Event Processing Developers Guide ■ Events flow from some source into an adapter of an application running in Oracle CEP. The arbitrary adapter is not required, it is shown only as an example. ■ The events flow from the adapter to an arbitrary processor; again, this processor is not required. ■ The processor sends the events to the built-in pub-sub adapter for remote publishing. The adapter in turn sends the events as messages to the remote HTTP pub-sub server for which the adapter is configured; this HTTP pub-sub server could be on another Oracle CEP instance, a WebLogic Server instance, or any other third-party implementation. The pub-sub adapter sends the messages to the channel for which it has been configured. ■ The remote HTTP pub-sub server then sends the message to all subscribers of the channel.

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

Figure 8–3 shows how the built-in pub-sub adapter for subscribing fits into a simple event processing network. The arbitrary processor and business POJO are not required, they are just an example of possible components in your application in addition to the pub-sub adapter. Figure 8–3 Built-In Pub-Sub Adapter For Subscribing Note the following in Figure 8–3 : ■ Messages are published to a remote HTTP pub-sub server, which could be another instance of Oracle CEP, WebLogic Server, or a third-party implementation. The messages are typically published by Web based clients shown in graphic, by the HTTP pub-sub server itself, or another server application. ■ The built-in pub-sub adapter running in an Oracle CEP application subscribes to the HTTP pub-sub server and receives messages from the specified channel. The adapter converts the messages into the event type configured for the adapter. ■ The pub-sub adapter sends the events to a processor. This processor is not required, it is shown only as an example of a typical Oracle CEP application. ■ The processor sends the events to a business POJO. Again, this business POJO is not required. For more information, see Section 8.1, Overview of HTTP Publish-Subscribe Server Adapter Configuration .