doag 2012 - introduction in eventing in soa suite 11g

35
1 | x Introduction in Eventing in Oracle SOA Suite 11g Ronald van Luttikhuizen 20-November-2012 | DOAG 2012

Upload: ronald-van-luttikhuizen

Post on 25-May-2015

1.994 views

Category:

Technology


0 download

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

Page 1: 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

Page 2: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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: [email protected]

• Blog: blog.vennster.nl

• Twitter: rluttikhuizen

Page 3: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 4: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 5: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 6: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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.

Page 7: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

7 | x

Case: Explanation

Page 8: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

8 | x

Case: Best Practice

Page 9: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 10: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 11: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

11 | x

Oracle and Event-Driven Architecture (EDA)

Filter Correlate Enrich Combine sensors

BAM

business events

notable events

event streams

business events

metrics

BI

Page 12: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 13: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

13 | x

Messaging Patterns

● Queueing

● Publish-subscribe

● Fire-and-forget

● Event-stream processing

Queue Consumer Producer

Page 14: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

14 | x

Messaging Patterns

● Queueing

● Publish/subscribe

● Fire-and-forget

● Event-stream processing

Topic Consumer Producer

Consumer

Consumer

Page 15: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

15 | x

Messaging patterns

● Queueing

● Publish/subscribe

● Fire-and-forget

● Event-stream processing

??? Producer

Page 16: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

16 | x

Messaging Patterns

● Queueing

● Publish/subscribe

● Fire-and-forget

● Event-stream processing

Producer

Producer

Producer

Event Processing

Engine

Page 17: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

17 | x

Eventing and synchronicity

Asynchronocity can also be achieved without eventing;

eventing is often more decoupled

Page 18: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

18 | x

Eventing and synchronicity

Eventing usually is asynchronous; but not necessarily

Product DB

Request Q

Response Q

Product WS

Page 19: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 20: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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, …

Page 21: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 22: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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');

Page 23: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

23 | x

Advanced Queuing (AQ)

Configuration in WebLogic

● Connection Pool and Data Source

● AQ Resource Adapter

Page 24: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 25: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 26: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

26 | x

Java Message Service (JMS)

Configuration in WebLogic

● JMS Servers and Modules

● JMS Resource Adapter

Page 27: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 28: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 29: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

29 | x

Event Delivery Network (EDN)

Configuration in JDeveloper

● Event Definition in EDL

● Publish or subscribe to EDN

Page 30: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 31: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 32: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

32 | x

Monitors & Sensors

● Composite Sensors to capture

relevant data for EM

● Monitoring Objects in BPEL to

notify other systems such as BAM

Page 33: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 34: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

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

Page 35: DOAG 2012 - Introduction in Eventing in SOA Suite 11g

35 | x

Thank you!

Ronald van Luttikhuizen

[email protected]