DOAG 2012 - Introduction in Eventing in SOA Suite 11g

Post on 25-May-2015

1.994 views 0 download

Tags:

description

Services and events are highly complementary instead of competing paradigms in the IT landscape. Oracle SOA Suite 11g emphasizes the importance of events by supporting the Event Delivery Network (or EDN) in the SCA infrastructure. This presentation provides an introduction of eventing in SOA Suite 11g. It will start by explaining the basics of events, introduce several messaging patterns such as fire-and-forget and publish/subscribe, and explain some real life examples of using events in an SOA landscape. It will then dive into the underlying eventing infrastructure of Oracle WebLogic Server 11g and Oracle SOA Suite 11g that is based on JMS and AQ, and demo their use both inside and outside SCA composites using resource adapters, PL/SQL, and Java. The presentation will finish with the discussion of Oracle SOA Suite 11g’s EDN and the use of sensors and monitors in SCA composites.

Transcript of DOAG 2012 - Introduction in Eventing in SOA Suite 11g

1 | x

Introduction in Eventing

in Oracle SOA Suite 11g

Ronald van Luttikhuizen

20-November-2012 | DOAG 2012

2 | x

Ronald van Luttikhuizen • Managing Partner at Vennster

• Oracle ACE Director for Fusion Middleware and SOA

• Author of different articles, co-author Oracle SOA Book 11g book

• Upcoming book SOA Made Simple

• Architect, consultant, trainer for Oracle, SOA, EDA, Java

• More than 10 years of software development and architecture

experience

• Contact: ronald.van.luttikhuizen@vennster.nl

• Blog: blog.vennster.nl

• Twitter: rluttikhuizen

3 | x

Agenda

1. What is Eventing and why use it ?

2. Oracle and Event-Driven Architecture

3. Messaging Patterns

4. Implementation & demo’s

5. Summary and Best Practices

4 | x

What is an event ?

● An event is the occurrence of something relevant that usually

requires action. An event signals a change in state.

• Business: new customer, employee has moved, invoice paid

• Technology: server down, response time above threshold

● Producers and consumers

5 | x

What is an event ?

● Contract

● Interface

● Implementation

Event

Header

Name, Type, Time, Producer, and so on

Body

Payload

1. Guaranteed delivery 2. Delta between occurrence and

delivery 3. Maximum # of messages 4. Message size

6 | x

Why use events in SOA?

Case: Organization modeling notifications in processes

Mistake: Dependencies between processes modeled

directly in the processes itself

Explanation: Process flow sometimes is influenced by other

processes. This was modeled into every process: this

makes processes tightly coupled to each other and hard

to change. It resulted in deadlocks.

7 | x

Case: Explanation

8 | x

Case: Best Practice

9 | x

Why eventing?

Complimentary ● Processes and services describe what should be

done, events about when something important occurs

Business ● Businesses are about events

• Better communication with business stakeholders

Technology ● Decoupling: no need to know consumers and

operations to invoke • Easier release management

• Different up-times

• Different rates of processing speed

10 | x

Agenda

1. What is Eventing and why use it ?

2. Oracle and Event-Driven Architecture

3. Messaging Patterns

4. Implementation & demo’s

5. Summary and Best Practices

11 | x

Oracle and Event-Driven Architecture (EDA)

Filter Correlate Enrich Combine sensors

BAM

business events

notable events

event streams

business events

metrics

BI

12 | x

Agenda

1. What is Eventing and why use it ?

2. Oracle and Event-Driven Architecture

3. Messaging Patterns

4. Implementation & demo’s

5. Summary and Best Practices

13 | x

Messaging Patterns

● Queueing

● Publish-subscribe

● Fire-and-forget

● Event-stream processing

Queue Consumer Producer

14 | x

Messaging Patterns

● Queueing

● Publish/subscribe

● Fire-and-forget

● Event-stream processing

Topic Consumer Producer

Consumer

Consumer

15 | x

Messaging patterns

● Queueing

● Publish/subscribe

● Fire-and-forget

● Event-stream processing

??? Producer

16 | x

Messaging Patterns

● Queueing

● Publish/subscribe

● Fire-and-forget

● Event-stream processing

Producer

Producer

Producer

Event Processing

Engine

17 | x

Eventing and synchronicity

Asynchronocity can also be achieved without eventing;

eventing is often more decoupled

18 | x

Eventing and synchronicity

Eventing usually is asynchronous; but not necessarily

Product DB

Request Q

Response Q

Product WS

19 | x

Agenda

1. What is Eventing and why use it ?

2. Oracle and Event-Driven Architecture

3. Messaging patterns

4. Implementation & demo’s

5. Summary and Best Practices

20 | x

Implementation or Channel

● Advanced Queueing (AQ)

● Java Message Service (JMS)

● Event Delivery Network (EDN)

● Monitoring Objects and Sensors

● Composite Sensors

Others:

● Oracle Event Processing (OEP)

● Oracle Technology Adapters: E-mail, File, Database Polling, Custom-Built

● 3rd party Message-Oriented Middleware (MOM)

● Social Media: Twitter, Facebook, LinkedIn, Google Talk

● Java Action Listeners

● AMQP implementations

and so on, and so on, …

21 | x

Advanced Queuing (AQ)

Requirement

● Need for eventing platform that can be used to integrate processes and services implemented in SOA Suite and Oracle RDBMS-based applications

Solution

● Use Advanced Queueing (AQ) as eventing platform

Characteristics

● Implementation: Oracle Database

● Payload types: RAW, Oracle Object, JMS

● Integration: PL/SQL, AQ Resource Adapter

● Delivery: Single-consumer and Multi-consumer

● Configuration: Transactionality, Filtering, Correlation, Retries

22 | x

Advanced Queuing (AQ)

CREATE USER JMSUSER IDENTIFIED BY JMSUSER;

GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE, AQ_USER_ROLE to JMSUSER;

GRANT EXECUTE ON DBMS_AQADM TO JMSUSER;

GRANT EXECUTE ON DBMS_AQ TO JMSUSER;

DBMS_AQADM.CREATE_QUEUE_TABLE(

Queue_table => ‘JMSUSER.NEW_CUST_ADDRESS_QT’,

Queue_payload_type => ‘SYS.XMLTYPE’,

Sort_list => ‘PRIORITY, ENQ_TIME’,

Multiple_consumers => ‘TRUE’);

DBMS_AQADM.CREATE_QUEUE(

Queue_name => 'JMSUSER.NEW_CUST_ADDRESS_QUEUE',

Queue_table => 'JMSUSER.NEW_CUST_ADDRESS_QT',

Max_retries => 5,

Retention_time => 10512000,

Retry_delay => 5);

DBMS_AQADM.START_QUEUE(Queue_name => 'JMSUSER.NEW_CUST_ADDRESS_QUEUE');

23 | x

Advanced Queuing (AQ)

Configuration in WebLogic

● Connection Pool and Data Source

● AQ Resource Adapter

24 | x

Webshop Database

Demo Advanced Queuing (AQ)

1. New order request inserted in Webshop Database with trigger that publishes

event

2. Start of SOA Composite Order-to-Cash instance through AQ Adapter

3. Stopping SOA Composite and insert new order

SOA Composite Order-to-Cash

AQ Queue New Order

Event

25 | x

Java Message Service (JMS)

Requirement

● Need for eventing platform that can be used to integrate processes and services implemented in SOA Suite and Java-based applications

Solution

● Use Java Message Service (JMS) provided by WebLogic Server as eventing platform

Characteristics

● Implementation: Application server such as WebLogic Server or 3rd party provider

● Persistency: In-memory and File-based

● Delivery: Queues and Topics

● Integration: Java, MDB, JMS Resource Adapter, JMS over AQ (hybrid)

● Configuration: Transactionality, Filtering, Correlation, Error Destination

26 | x

Java Message Service (JMS)

Configuration in WebLogic

● JMS Servers and Modules

● JMS Resource Adapter

27 | x

Demo Java Message Service (JMS)

1. SOA Composite Order-to-Cash publishes new billing event through JMS Topic

2. SOA Composite Billing generates invoice

3. Java CRM Application stores billing info with customer records

SOA Composite Order-to-Cash

JMS topic SOA Composite BillingService

Java CRM Application

28 | x

Event Delivery Network (EDN)

Requirement

● Need for light-weight and declarative eventing platform that can be used within SOA Suite

Solution

● Use Event-Delivery Network (EDN) as eventing platform

Characteristics ● Introduced in SOA Suite 11g

● Implementation: Light-weight framework on top of AQ (EDN-DB) or JMS (EDN-JMS)

● Features: Basic eventing features

● Delivery: Publish/subscribe

● Integration: BPEL, Mediator, ADF BC, PL/SQL and Java API

● Usage and configuration: Technology-neutral and declarative, Event Definition Language (EDL) uses XML message types, Filtering

29 | x

Event Delivery Network (EDN)

Configuration in JDeveloper

● Event Definition in EDL

● Publish or subscribe to EDN

30 | x

Demo Event Delivery Network (EDN)

1. SOA Composite Order-to-Cash publishes dunning event through EDN; SOA

Composite DunningService is subscribed and started

2. Publication of payment event through EM

3. Event correlated to Order-to-Cash process

SOA Composite Order2Cash

SOA Composite DunningService EDN

31 | x

Monitors & Sensors

Requirement

● Push relevant data from running process and service instances to monitoring tools such as BAM, EM, and other 3rd party tools with minimum impact

Solution

● Use Monitoring Objects to push data to BAM and other tools

● Use Composite Sensors to push data to Enterprise Manager

sensor data

BAM

EM

sensor data

32 | x

Monitors & Sensors

● Composite Sensors to capture

relevant data for EM

● Monitoring Objects in BPEL to

notify other systems such as BAM

33 | x

Agenda

1. What is Eventing and why use it ?

2. Oracle and Event-Driven Architecture

3. Messaging patterns

4. Implementation & demo’s

5. Summary and Best Practices

34 | x

Summary & Best Practices

● SOA is not only about (synchronous) services and processes

(what); also events (when)

• Model events in your BPM and SOA projects

• Use events to notify running processes

• Expand service registry to include events

• Use events for additional decoupling between processes and services

● Not just queuing, also pub/sub and event stream processing

● Not a single best technology for implementation

35 | x

Thank you!

Ronald van Luttikhuizen

ronald.van.luttikhuizen@vennster.nl