Upload
snalza
View
215
Download
0
Embed Size (px)
Citation preview
8/3/2019 Doernenburg_EnterpriseIntegration
1/34
8/3/2019 Doernenburg_EnterpriseIntegration
2/34
EMEA
2
Enterprise Integration
Erik Doernenburg
ThoughtWorks, Inc.
8/3/2019 Doernenburg_EnterpriseIntegration
3/34
EMEA
Copyright ThoughtWorks, Inc. 20053
Agenda
Challenges in enterprise application development
Design patterns
Enterprise Integration patterns
Interop technologies
Conclusion & Resources
8/3/2019 Doernenburg_EnterpriseIntegration
4/34
EMEA
Copyright ThoughtWorks, Inc. 20054
The challenge
Enterprises depend on a growing number of IT systems
The systems must provide an integrated solution for theenterprise
The systems must interoperate with each other
Architectural trends and waves of technologies
Changing business needs and requirements
8/3/2019 Doernenburg_EnterpriseIntegration
5/34
EMEA
Copyright ThoughtWorks, Inc. 20055
Existing Systems
New System
Finance Operator Application
Workflow items are stored on Tibco RV/CM queue
Tibco Integration Manager organises workflow
handles imports from document recognition
handles interaction with existing ERP systems
Reference data imported using linked servers
fax/telex
mail document
recognition
app web
ERP ref. data
8/3/2019 Doernenburg_EnterpriseIntegration
6/34
EMEA
Copyright ThoughtWorks, Inc. 20056
New application
Existing
Portfolio Management Tool
Front-end uses Office 2003code-behind technology
communicates with server using
WebSphere MQ queues
Message format defined withXSD schema
Application uses existing services accesses analytics library with
COM bridge
accesses stored deals throughdeal manager service
accesses service bus through
messaging abstraction library
analytics
library
Existing
deal
manager
Existing
messaging
library
technology
adaptor
Excelfront-end
application
logic
8/3/2019 Doernenburg_EnterpriseIntegration
7/34
EMEA
7
Design Patterns
8/3/2019 Doernenburg_EnterpriseIntegration
8/34
EMEA
Copyright ThoughtWorks, Inc. 20058
Why design patterns?
Code reuse remains difficult
but
Knowledge reuse can be very valuable
Patterns encapsulate knowledge of successful designs
8/3/2019 Doernenburg_EnterpriseIntegration
9/34
EMEA
Copyright ThoughtWorks, Inc. 20059
Using technology successfully
Syntax
Basic language mechanism
A necessity but not a guarantee
Constructs
Classes, Interfaces, Inheritance, Polymorphism, etc. Helpful but not sufficient for good design
Principles
Separation of concerns, Dependency Injection, etc.
Steer us towards a better solution
Patterns
Model-View-Controller, Observer, Decorator
Concrete design guidance
8/3/2019 Doernenburg_EnterpriseIntegration
10/34
EMEA
Copyright ThoughtWorks, Inc. 200510
Patterns
Mind sized chunk of information (Ward Cunningham)
Shows a good solution to a common problem within a
specific context
Observed from actual experience
Has a distinct name
Not copy-paste
ThoughtWorks collaborates with Microsoft to document
design patterns for the .NET platform
8/3/2019 Doernenburg_EnterpriseIntegration
11/34
EMEA
Copyright ThoughtWorks, Inc. 200512
Enterprise Integration Patterns
Gregor Hohpe defined a visual pattern language describing
message-based enterprise integration solutions
Pattern language comprises 65 patterns in 6 categories
Application
A
Application
B
MessageChannel
Router TranslatorEndpoint Endpoint
MonitoringMessaging
Endpoints
MessagingChannels
MessageConstruction
Message
Routing MessageTransformation
System
Management
8/3/2019 Doernenburg_EnterpriseIntegration
12/34
EMEA
Copyright ThoughtWorks, Inc. 200514
Pattern: Request-Response
Service Consumer and Provider (similar to RPC)
Channels are unidirectional
Two asynchronous point-to-point channels
Separate request and response messages
Request Channel
Response
Request
Reply Channel
ProviderConsumer
8/3/2019 Doernenburg_EnterpriseIntegration
13/34
EMEA
Copyright ThoughtWorks, Inc. 200515
Multiple consumers
Each consumer has its own reply queue
But how does the provider send the response?
Could send to all consumers (very inefficient)
Hard code (violates principle of context-free service)
Responses
Requests
?
Requests
Request Channel
Reply Channel 1
Reply Channel 2
ProviderConsumer 1
Consumer 2
8/3/2019 Doernenburg_EnterpriseIntegration
14/34
EMEA
Copyright ThoughtWorks, Inc. 200516
Pattern: Return Address
Consumer specifies Return Address (the reply channel)
in the request message
Service provider sends response message to specified
channel
Responses
Reply
Channel 1 ReplyChannel 2
Request Channel
Reply Channel 1
Reply Channel 2
ProviderConsumer 1
Consumer 2
8/3/2019 Doernenburg_EnterpriseIntegration
15/34
EMEA
Copyright ThoughtWorks, Inc. 200517
Load-balanced service providers
Request message can be handled by multiple providers
Point-to-pointchannel supports competing services
Only one service receives each request message
But what if the response messages are out of order?
Request Channel
Reply Channel
Provider 1
Provider 2
Consumer
8/3/2019 Doernenburg_EnterpriseIntegration
16/34
EMEA
Copyright ThoughtWorks, Inc. 200518
Pattern: Correlation Identifier
Consumer assigns a unique identifier to each message
Identifier can be an arbitrary ID, a GUID, a business key
Provider copies the ID to the response message
Consumer can match request and response
Message
Identifier 1
2
1 2
1212
1 2
12
Correlation
Identifier
Request Channel
Reply Channel
Provider 1
Provider 2
Consumer
8/3/2019 Doernenburg_EnterpriseIntegration
17/34
EMEA
Copyright ThoughtWorks, Inc. 200520
Multiple specialised providers
Each provider can only handle a specific type of message
Route the request to the "appropriate" provider. But how?
Do not want to burden sender with decision
Letting providers "pick out" messages requires
coordination
Order
Entry
Widget Inv.
?
Order Messages
Gadget Inv.
8/3/2019 Doernenburg_EnterpriseIntegration
18/34
EMEA
Copyright ThoughtWorks, Inc. 200521
Pattern: Content-Based Router
Insert a content-based router
Routers forward incoming messages to different channels
Message content not changed
Mostly stateless, but can be stateful, e.g. de-duper
Order
Entry
Widget Inv.Order Messages
Gadget Inv.
ContentBased
Router
8/3/2019 Doernenburg_EnterpriseIntegration
19/34
8/3/2019 Doernenburg_EnterpriseIntegration
20/34
EMEA
Copyright ThoughtWorks, Inc. 200523
Pattern: Splitter & Router
Use a splitter to break out the composite message into a
series of individual messages
Then use a router to route the individual messages as before
Note that two patterns are composed
Widget Inv.
Gadget Inv.
Order
Entry
RouterSplitter
Order
MessageOrder
Items
Order
Item 1
Order
Item 2
8/3/2019 Doernenburg_EnterpriseIntegration
21/34
EMEA
Copyright ThoughtWorks, Inc. 200524
Producing a single response
How to combine the results of individual but related
messages?
Messages can be out-of-order, delayed
Multiple conversations can be intermixed
Widget Inv.
Gadget Inv.
Billing
Order
Item 1 Response 1
Order
Item 2Response 2
Confirmed
Order
?
8/3/2019 Doernenburg_EnterpriseIntegration
22/34
8/3/2019 Doernenburg_EnterpriseIntegration
23/34
EMEA
Copyright ThoughtWorks, Inc. 200526
Communicating with multiple parties
How to send a message to a dynamic set of recipients?
And return a single response message?
Request
For Quote
Vendor A
Vendor B
Quotes
AggregatorBest
Quote
Vendor C?
8/3/2019 Doernenburg_EnterpriseIntegration
24/34
EMEA
Copyright ThoughtWorks, Inc. 200527
Pattern: Scatter-Gather
Send message to a pub-sub channel
Interested recipients subscribe to a "topic"
Aggregator collects individual response messages
may not wait for all quotes, only returns one quote
Request
For Quote
Vendor A
Vendor B
Quotes
AggregatorBest
Quote
Vendor C
Pub-Subchannel
8/3/2019 Doernenburg_EnterpriseIntegration
25/34
EMEA
Copyright ThoughtWorks, Inc. 200528
Complex composition
Receive an order message
Use splitter to create one message per item
Send to scatter/gather which returns "best quote" message
Aggregate to create quoted order message
Quote request
for each item
Vendor A
Vendor B
Quotes
AggregatorBest Quote
for each item
Vendor C
Aggregator
Splitter
Pub-Subchannel
8/3/2019 Doernenburg_EnterpriseIntegration
26/34
EMEA
29
Interop technologies
8/3/2019 Doernenburg_EnterpriseIntegration
27/34
EMEA Copyright ThoughtWorks, Inc. 200530
Resource based
RPC style / distributed objects
Message based / document-oriented
Major interop technologies
DB files
RMI-IIOP
(CORBA)
MOM
in-process
bridge
WS-*
WSRemoting
(DCOM)
WS
8/3/2019 Doernenburg_EnterpriseIntegration
28/34
EMEA Copyright ThoughtWorks, Inc. 200531
Interop technology characteristics
point-to-point
transient messages
durable message
server lifetime-
management
bridgeRemoting
(DCOM)
RMI-IIOP
(CORBA)WSMOMDB/files
routable
WS-*
clustering
in-proc.NETserver
J2EEserver
platformneutral
WSMOM WS-*
8/3/2019 Doernenburg_EnterpriseIntegration
29/34
8/3/2019 Doernenburg_EnterpriseIntegration
30/34
EMEA Copyright ThoughtWorks, Inc. 200533
Why Web Services?
Web services provide all benefits of messaging solution
loose-coupling
service oriented
reliable communication
Why web services?
composable protocol
vendor neutral
suitable for access through Internet
8/3/2019 Doernenburg_EnterpriseIntegration
31/34
EMEA Copyright ThoughtWorks, Inc. 200534
Web Services development
Web Services are expected to become the default Messaging
solution in the future
WS-* standards are evolving rapidly, most important
WS-Security
WS-Policy
WS-Addressing
WS-I defines profiles, sample applications and testing tools
Profiles are guidelines for using WS specifications
Use Basic profile 1.1 to build interoperable solutions
Further research on WS is being carried out
8/3/2019 Doernenburg_EnterpriseIntegration
32/34
EMEA Copyright ThoughtWorks, Inc. 200536
Conclusion
Enterprise systems are becoming more complex
We have patterns to help us with the design
We have technologies to implement our designs
Building for interoperability and integration is key
8/3/2019 Doernenburg_EnterpriseIntegration
33/34
8/3/2019 Doernenburg_EnterpriseIntegration
34/34
Please complete your session
feedback form
THANK YOU