47
Announcements Project proposal assignment is open, due tonight by midnight See instructions for CMS group formation do this first

Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Announcements

• Project proposal assignment is open, due tonight by midnight

• See instructions for CMS group formation

• do this first

Page 2: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

EAI - Workflow - Web Technologies

• Message Brokers, EAI, Workflow

• [ACKM04] Ch 3

• Web Technologies, J2EE Introduction

• [ACKM04] Ch 4

Page 3: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Business Process

• A Supply Chain ...

• This is really a sequence of atomic transactions

• Some txns could happen concurrently ...

Page 4: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Business Process - Workflow

• Why do things this way on computer?

• Lots of reasons ...

• Availability

• need all the resources at once

• Resource contention

• hold only the subset of resources you needed now => better throughput

• Legacy systems

• may not have distributed commit

Page 5: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

ACID Properties?

• Clearly fails to provide Isolation

• other txns can read state between committed steps

• e.g. transfer funds by withdraw and deposit as separate txns

• can view this as expanding set of “consistent” states

• highly application dependent

Page 6: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

ACID Properties?

• Atomicity?

• not in short term -- same argument as for isolation!

• long term -- to roll back a sequence of transactions, execute a compensating transaction for each committed step

• but this is not always possible

• S1 makes deposit to bank acct

• S2 makes withdrawal

• Later we try to compensate for S1’s deposit and find insufficient funds ...

Page 7: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Enterprise Application Integration (EAI)

• Inventory, ERP and Shipping are legacy apps

• all run independent transactions

• New dispatcher app integrates them

dispatcherinventory management ERP shipping

message-oriented middlewarenew PO new PO new PO

Page 8: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

EAI

• With traditional MOM, integrating another application requires changing the dispatcher

• Is this really necessary?

dispatcherinventory management ERP shipping

message-oriented middleware

month-end closing

new PO new PO new PO new PO

Page 9: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Message Broker

• Message broker determines destinations

• based on sender identity, message type, message content

• Senders do not specify or know who the receivers are!

message broker core

sender receiver

with message brokers, custom message routing logic can be defined at the message broker level or at the queue level

in basic MOM it is the sender who specifies the identity of the receivers

Page 10: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Publish / Subscribe

• Publication:

• enqueue a message

• Subscription: specifies

• message type (e.g. purchase order)

• Boolean filter function on messages

• Message broker sends copy of each publication to each matching subscription

• Persistent?

Page 11: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Variant: Java Message Service

• Explicit topic takes place of message type

• Publication:

• Publisher specifies a topic

• Subscription:

• Subscriber specifies topic and filter predicate

Page 12: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

EAI Using Message Broker

• Add new application by altering routing specification in Message Broker ...

• Publish / Subscibe

• Fine as long as new application expects existing message type

dispatcher(publisher)

inventory management(subscriber)

ERP(subscriber)

shipping(subscriber)

message broker

month-end closing

(subscriber)

new PO new PO new PO new PO new PO

Page 13: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

More Precisely ...• Dispatcher is new integrating application

• Legacy applications get adapters

DBMS applications

message broker

SmartQuotationadapter

e-mailadapter

databaseadapter

SmartQuotation

SmartForecastingadapter

SmartForecasting

XYZadapter

XYZ

integrating application (contains the composition logic)

Page 14: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Recall: Business Process

• A Supply Chain of automated and manual steps

• WfMS supervises all steps

• Even the manual ones (using eMail)

Page 15: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Workflow Specificationcheck if

offered product

check if worth proceeding

get quote from quotation system

get quote from supplier

enter quotein forecasting system

send quote to customer

ContractExists=true

ContractExists=false

Offered=true

Offered=false

GoAhead=true

update quotation system

variables: QuoteReferenceNumber: int Customer: String Item: String Quantity: int RequestedDeliveryDate: Date DeliveryAddress: String GoAhead: Bool ContractExists: Bool Offered: Bool

else

Page 16: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Workflow Specificationcheck if

offered product

enter quotein forecasting system

send quote to customer

Offered=true

Offered=false

Start Node

Work Node

Routing Node (decision)

Routing Node (parallel)

Work Nodes

Completion Nodes

Page 17: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Workflow System

workflow engine

resource broker

completed work items

inbound queue

resource 1

resource 2

resource n

1

2

4 53

workflow definitionsoutbound queues

workflow designer

Page 18: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Error Conditions

• Deadline for step completion

• WfMS takes corrective action

• Exception detected in application

• Several mechanisms to raise exception

Page 19: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Error Conditions - Recovery

• Forward Recovery

• State of workflow maintained by WfMS

• Server fails => restart from that point

• Like recovery from transactional RPC

• Backward Recovery

• Execute compensating action to undo each previous action of workflow in reverse order

• Like rollback in Sagas

Page 20: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Combining - Integrating App is WfMS

DBMS applications

message broker

SmartQuotationadapter

e-mailadapter

databaseadapter

SmartQuotation

SmartForecastingadapter

SmartForecasting

XYZadapter

XYZ

WfMS adapter

WfMS Integrating App (Dispatcher)

Page 21: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Internet Protocols

IP

TCP

TLS / SSL

HTTPSSSHHTTPFTP SMTPTELNET

unreliable packets

reliable byte stream

authentication encryption

remote login

filetransfer

mailhypertext transfer

shellhypertext transfer

secure

Page 22: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

HTTP is really simple

Request (GET/PUT/POST/OPTIONS/DELETE)URIMessage

StatusMessage

.

.

.

Page 23: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

HTTP is really simple

• URI: think URL (host + path)

• server.dnsname.com/file/path/name

• Message: think MIME encoded file

• arbitrary sequence of bytes of identified type

• Persistent connection

Page 24: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Simple HTTP Connection

• Occasionally

• if client and server are both behind the same firewall

• And they trust one another!

HTTPclient

HTTPserver

Page 25: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

HTTP Connection

• Server behind firewall and HTTP gateway

• More realistic

wide

are

a ne

twor

k (I

nter

net)

HTTPserver

HTTPgateway fi

rewa

ll

HTTPclient

Page 26: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

HTTP Connection

• Two firewalls, HTTP proxy, HTTP gateway

HTTPclient

wide

are

a ne

twor

k (I

nter

net)

HTTPproxy

HTTPserver

HTTPgateway fi

rewa

ll

fire

wall

HTTP tunnel

Page 27: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

SSL

• Secure (encrypted) channel between client and server

• Server authenticated to client

• Client optionally authenticated to server

• Public Key certificates

Page 28: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

HTTPS - SSL

HTTPSclient

Secure Sockets Layer (SSL)

HTTPSserver

TCP/IP

network layer

application layer

Page 29: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

HTTPS Connection

HTTPS client

wide

are

a ne

twor

k (I

nter

net)

HTTPSproxy

HTTPSserver

HTTPSgateway fi

rewa

ll

fire

wall

HTTPS tunnel

Page 30: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Recall 3-Tier

client

server (resource manager)

middleware

client...

Page 31: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Adapter to HTTP client

client

server (resource manager)

middleware

HTTPserver

HTTPclient

Page 32: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

This also works 2-Tier

server (resource manager)

HTTPserver

HTTPclient

Page 33: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

wide

are

a ne

twor

k (I

nter

net)fire

wall

Over the Web

client

server (resource manager)

middleware

HTTPserver

HTTPclient

Page 34: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

wide

are

a ne

twor

k (I

nter

net)fire

wall

Client is a browser

client

server (resource manager)

middleware

Webserver

browser

Web server sendsHTML to browser

Web server is clientof middle tier

Page 35: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

wide

are

a ne

twor

k (I

nter

net)fire

wall

Still Works 2-Tier

server (resource manager)

Webserver

browser

Web server sendsHTML to browser

Web server talksdirectly to database

Page 36: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Thin Client in Browser

• HTML forms

• cookies

client

browser

JavaScript

client

browser

java virtual machineapplet

JavaScriptVBScript

Applets

Page 37: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Web Server is Client of Middleware

• Or maybe of the database!

• Technology to do this:

• CGI

• Servlets

• Ways to make web server execute code

Page 38: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

CGI

• Create Process, run arbitrary program

• But very expensive

middleware

Web server

browser

wide

are

a ne

twor

k (I

nter

net)

fire

wall

HTTP GET request

client

CGI program

server (resource manager)

Page 39: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Servlets

• JVM part of Web server

• No process creation

• Cache state

middleware

browser

wide

are

a ne

twor

k (I

nter

net)

fire

wall

HTTP GET request

client

Web server

Java server process

Java thread

server (resource manager)

Page 40: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Application Server

• Middleware specialized for Web access

• Presentation layer plays more important role

Page 41: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Application Server - General

connection to resource mgmt layer

presentation layer

resource management layer

application logic layer

client

application server

Web server

wide

are

a ne

twor

k (I

nter

net)

fire

wall HTTP

browser

other protocols

other servers (email, SOAP,..)

This is probably HTML data

Page 42: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

J2EE Application Server Architecture

support for communication and presentation

Servlets JavaServer Pages (JSP)

Enterprise Java Beans (EJB)

Java DataBase Connectivity (JDBC)

Java Naming/Directory Interface (JNDI)

support for the application integration

Java 2 Connector Architecture (J2CA)

Java Message Service (JMS)

Java transaction API (JTA)

Java API for XML Processing (JAXP)

JavaMail

Java Authentication and Authorization Service (JAAS)

support for access to resource managers

Page 43: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

J2EE Application Server Architecture - II

application logic layer

presentation layer

serv

ices

(load

balan

cing

, po

oling,

ca

ching,

tra

nsac

tion

, pe

rsiste

nce,

…)

administr

ation

(man

agem

ent

and

secu

rity

)

application server

EJB EJB

JDBC

EJB

JNDI

J2CA resource adapter

J2CA resource adapter

other adapters

DBMS applications

enterprise system 1

enterprise system 2

enterprise system n

EJB container

JMS

Page 44: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

J2EE Application Server Architecture - III

Web serverE-mail serverservers for other

connections (e.g., WAP)

presentation layer

Servlets JSPs

multidevice content delivery

personalization logic

connection to resource mgmt layer

resource management layer

application logic layer

serv

ices

(load

balan

cing

, po

oling,

cac

hing

,…)

XML support

Web services support

administr

ation

(man

agem

ent

and

secu

rity

)

application server

client

Page 45: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Wide Area Integration

client

server (resource manager)

middleware

client

server (resource manager)

middleware

wide

are

a ne

twor

k (I

nter

net)

Page 46: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Wide Area Integration

• Middleware instances need to communicate

client

server (resource manager)

middleware

client

server (resource manager)

middleware

wide

are

a ne

twor

k (I

nter

net)

remote-middlewareprotocol

WAN communicationprotocol

remote-middlewareprotocol

WAN communicationprotocol

Page 47: Announcements - cs.cornell.edu · EAI - Workflow - Web Technologies • Message Brokers, EAI, Workflow • [ACKM04] Ch 3 • Web Technologies, J2EE Introduction • [ACKM04] Ch

Tunneling Through Firewalls

client

wide

are

a ne

twor

k (I

nter

net)Web

server clientWeb

server

fire

wall

fire

wall

HTTP tunnel

server (resource manager)

server (resource manager)

middlewareremote-middleware

protocolWAN communication

protocol

middlewareremote-middleware

protocolWAN communication

protocol