Event Delivery Network - chapter one

Using Business Events is one of the big new features in SOA Suite 11g, namely through the Event Delivery Network (EDN)

So how can you make use of events?

First - you need to define the data-shape of the event. This is done conventionally through the usage of XMLSchema.

E.g. below we define an event for anew order (NewOrderSubmittedInfo) that only contains the OrderId in the namespace /oracle/fodemo/storefront/entities/events/schema/OrderEO


<xs:schema
targetNamespace="/oracle/fodemo/storefront/entities/events/schema/OrderEO"
xmlns="/oracle/fodemo/storefront/entities/events/schema/OrderEO"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="NewOrderSubmittedInfo">
<xs:complexType>
<xs:sequence>
<xs:element name="OrderId" type="xs:string" minOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Next we are defining the Business Event through orderevents.edl.
An event will be in its own namespace (/oracle/fodemo/storefront/entities/events/edl/OrderEO), and imports the datashape through conventional means of a wsdl-alike import construct.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://schemas.oracle.com/events/edl"
targetNamespace="/oracle/fodemo/storefront/entities/events/edl/OrderEO">
<schema-import namespace="/oracle/fodemo/storefront/entities/events/schema/OrderEO"
location="OrderEO.xsd"/>

<event-definition name="NewOrderSubmitted">
<content xmlns:ns0="/oracle/fodemo/storefront/entities/events/schema/OrderEO"
element="ns0:NewOrderSubmittedInfo"/>
</event-definition>
</definitions>

How can you publish / subscribe to an event from your composite? The answer is simple, from the Mediator component.

After you have defined those you will see little event icons on the component, derived from the component definition.
11g_mediator_events.jpg
You might want to check out the composite descriptor's sources (composite.xml) - specifically the subscription noted on the mediator.


<component name="OrderPendingEvent">
<implementation.mediator src="OrderPendingEvent.mplan"/>
<business-events>
<subscribe xmlns:sub1="/oracle/fodemo/storefront/entities/events/edl/OrderEO"
name="sub1:NewOrderSubmitted" consistency="oneAndOnlyOne"
runAsRoles="$publisher"/>

<publishes xmlns:pub1="/oracle/fodemo/storefront/entities/events/edl/OrderEO"
name="pub1:OrderCompleted"/>
</business-events>
</component>

Next step, testing the event subscription through the remote API.

First you need to define the event in an understandable format. The key here is the <business-event xmlns="http://oracle.com/fabric/businessEvent"> shape, that contains metadata information about the event, such as qname (corresponding to the event defined in your EDL) and a unique id. In the <content> section, you'll put the real event data, as shown below


<business-event xmlns:ns1="/oracle/fodemo/storefront/entities/events/edl/OrderEO"
xmlns="http://oracle.com/fabric/businessEvent">
<name>ns1:NewOrderSubmitted</name>
<id>e4196227-806c-4680-a6b4-6f8df931b3f5</id>
<content>
<NewOrderSubmittedInfo
xmlns="/oracle/fodemo/storefront/entities/events/schema/OrderEO">
<OrderId>
<newValue>52640293</newValue>
</OrderId>
</NewOrderSubmittedInfo>

</content>
</business-event>

Once done you can use ant, or just call our provided java class (oracle.integration.platform.blocks.event.SendEvent) that will submit the event to EDN.


<!-- send an event via api -->
<java classpathref="soaClasspath"
classname="oracle.integration.platform.blocks.event.SendEvent"
fork="true" failonerror="true">
<arg line="-dbconn ${soa.db.connectstring}
-dbuser ${soa.db.username}
-dbpass ${soa.db.password}
-event orderEvent.xml"/>
</java>

Here -dbuser is the owner of the <prefix>_ soainfra schema, and the connect string (-dbconn) represents the database hosting this schema, e.g. somedb.host.com:db.host.port:db.sid

Comments:

Hi, Oracle SOA 11g Developer Guide says its possible to raise Business Events in ADF BC through Remote Event Connection. However, there is no information how to establish this Remote Event Connection from ADF BC. I want to deploy ADF BC application on separate WebLogic server, not on the same with SOA Composites. Thanks, Andrejus

Posted by Andrejus Baranovskis on August 19, 2009 at 02:59 AM PDT #

Hi, You can create a ADF BC application and deploy it to one server and Create a composite application and deploy to another server. Only thing to make sure is that EDN datasources have been configured. Using Oracle WebLogic Server Administration Console, verify that EDNDataSource and EDNLocalTxDataSource have been configured and targeted to the server. Refer : http://fmwdocs.us.oracle.com/doclibs/fmw/E10285_01/doc.1111/e10308/uc_bpel_bc.htm#OADEV213 I have tried this on 2 separate server :-)

Posted by Mona on October 07, 2009 at 10:04 AM PDT #

>>http://fmwdocs.us.oracle.com/doclibs/fmw/E10285_01/doc.1111/e10308/uc_bpel_bc.htm#OADEV213 << Is there an equivalent link accessible on the Internet, for lesser mortals outside the Oracle network?? Please do post that.. Many thanks :-)

Posted by Jang Vijay Singh on November 09, 2009 at 09:08 AM PST #

In a service-oriented world, a level of abstraction is needed for creation and use of events using business semantics, without the publisher or subscriber of the event ever having to worry about the mechanics of messaging. Oracle SOA Suite 11g addresses this with the introduction of a new feature in the form of the Event Delivery Network.

Posted by frauenmantel on December 09, 2009 at 09:38 PM PST #

Hi Where is the definition of the event into an understandable format placed? thanks

Posted by Damien on May 31, 2010 at 07:30 PM PDT #

Where does the data gets persisted on application server for the Event Delivery Network. Can u share the table names.... Thanks

Posted by srikant on June 28, 2010 at 10:03 PM PDT #

it's in queues - EDN_MAIN / EDN_OAOO ~ but that's an impl detail ..

Posted by clemens.utschig on July 03, 2010 at 04:07 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips and tricks straight from the SOA / BPM development team at Oracle HQ

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today