Example: confidence

Enterprise Integration Patterns

Enterprise Integration PatternsAsynchronous Messaging Architecturesin PracticeTest MessageSplitterEnricherTranslatorAggrega torGregor Hohpe2 Copyright 2003 Gregor HohpeEnterprise Integration PatternsIntegration Challenges Users want to execute business functions that span multiple applications Requires disparate applications to be connected to a common Integration solution However: Networks are slow Networks are unreliable No two applications are alike Change is InevitableIsolated SystemsUnified Access3 Copyright 2003 Gregor HohpeEnterprise Integration PatternsMessage-Oriented MiddlewareMessage-oriented architectures provide loose couplingand reliabilitySystemASystemASystemBSystemBC hannelMessage Remove location dependencies Remove temporal dependencies Remove data format dependencies Channels are separate from applications Channels are asynchronous & reliable Data is exchanged in self-contained messages4 Copyright 2003 Gregor HohpeEnterprise Integration PatternsThinking AsynchronouslyOrder MgmtShippingOrder MgmtShippingInventoryInventoryWeb SiteWeb SiteNew OrderNew OrderConfirmNew OrderConfirmIdleNew OrderConfirmConfirmSynchronousAsynchrono us5 Copyright 2003 Gregor HohpeEnterprise Integration PatternsMany Products & Implementations Message-oriented middleware (MOM)

Enterprise Integration Patterns Asynchronous Messaging Architectures in Practice Test Message Splitter Enricher Translator Aggregator Gregor Hohpe

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Enterprise Integration Patterns

1 Enterprise Integration PatternsAsynchronous Messaging Architecturesin PracticeTest MessageSplitterEnricherTranslatorAggrega torGregor Hohpe2 Copyright 2003 Gregor HohpeEnterprise Integration PatternsIntegration Challenges Users want to execute business functions that span multiple applications Requires disparate applications to be connected to a common Integration solution However: Networks are slow Networks are unreliable No two applications are alike Change is InevitableIsolated SystemsUnified Access3 Copyright 2003 Gregor HohpeEnterprise Integration PatternsMessage-Oriented MiddlewareMessage-oriented architectures provide loose couplingand reliabilitySystemASystemASystemBSystemBC hannelMessage Remove location dependencies Remove temporal dependencies Remove data format dependencies Channels are separate from applications Channels are asynchronous & reliable Data is exchanged in self-contained messages4 Copyright 2003 Gregor HohpeEnterprise Integration PatternsThinking AsynchronouslyOrder MgmtShippingOrder MgmtShippingInventoryInventoryWeb SiteWeb SiteNew OrderNew OrderConfirmNew OrderConfirmIdleNew OrderConfirmConfirmSynchronousAsynchrono us5 Copyright 2003 Gregor HohpeEnterprise Integration PatternsMany Products & Implementations Message-oriented middleware (MOM)

2 IBM WebSphere MQ Microsoft MSMQ Java Message Service (JMS) Implementations EAI Suites TIBCO, WebMethods, SeeBeyond, Vitria, .. Asynchronous Web services WS-ReliableMessaging, ebMS Sun s Java API for XML Messaging (JAXM) Microsoft s Web Services Extensions (WSE)HOTHOTThe Underlying Design Principles Are the Same!6 Copyright 2003 Gregor HohpeEnterprise Integration PatternsCatalog of 65 PatternsMessageConstructionMessagingChan nelsApplicationAApplicationBMessageChann elRouterTranslatorEndpointEndpointMonito ringMessagingEndpointsMessageRoutingMess ageTransformationSystemsManagementComman d MessageRPC MessageQuery MessageDocument MessageEvent MessageReply MessageReturn AddressCorrelation IdentifierMessage SequenceMessage ExpirationCanonical Data ModelFormat IndicatorPoint-to-Point ChannelPublish-Subcr. ChannelDurable SubscriberDatatype ChannelInvalid Message ChannelDead Letter ChannelGuaranteed MessagingChannel AdapterContent-Based RouterMessage FilterRecipient ListSplitterAggregatorResequencerDistrib ution w.

3 Aggr. TableProcessManagerData EnricherContent FilterCheck LuggageControl BusMessage HeaderEnvelope WrapperMessage HistoryMessage StoreChannel PurgerTest MessageMessaging AdapterPolling ConsumerEvent-Driven ConsumerTransactional ClientCompeting ConsumersMessage DispatcherMessage SelectorIdempotent ReceiverMessaging Mapper1. Request-ReplyExample2. Order ManagementExample3. Bonus7 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Request-ReplyConsumerProviderRequest Service Provider and Consumer (similar to RPC) Channels are unidirectional Two asynchronous Point-To-Point Channels Separate request and reply messagesRequest ChannelReply ChannelReply8 Copyright 2003 Gregor HohpeEnterprise Integration PatternsMultiple Consumers ProviderRequestsRequestsRequest ChannelConsumer1 Consumer1??Reply Channel 1 Consumer2 Consumer2 Reply Channel 2 Replies Each consumer has its own reply queue How does the provider know where to send the reply?

4 Could send to all consumers very inefficient Hard code violates principle of context-free service9 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Return AddressConsumer1 Consumer1 RepliesConsumer2 Consumer2 Request ChannelReply Channel 1 Reply Channel 2 Consumer specifies Return Address(reply channel) in the request message Service provider sends reply message to specified channelReplyChannel 1 ReplyChannel 2 Provider10 Copyright 2003 Gregor HohpeEnterprise Integration PatternsMultiple Service ProvidersProvider 1 Provider 1 ConsumerConsumerProvider 2 Provider 2 Request ChannelReply Channel Request message can be consumed by more than one service provider Point-to-PointChannelsupports Competing Consumers, only one service receives each request message Channel queues up pending requests11 Copyright 2003 Gregor HohpeEnterprise Integration PatternsMultiple Service ProvidersReply 1 Reply messages get out of sequence How to match request and reply messages?

5 Only send one request at a time very inefficient Rely on natural order bad assumptionService 1(slow)Request 1 Service 2(fast)ConsumerRequest 2 Reply 212 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Correlation IdentifierMessageIdentifier12 Provider 1 Provider 1 Provider 2 Provider 2 Request ChannelResponse Channel1212121212 CorrelationIdentifierCorrelateRequest & ReplyConsumer Equip each message with a unique identifier Message ID (simple, but has limitations) GUID (Globally Unique ID) Business key ( Order ID) Provider copies the ID to the reply message Consumer can match request and response13 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Pipes-And-FiltersPipe Connect individual processing steps (filters) with message channels (pipes) Pipes decouple sender and receiver Participants are unaware of intermediaries Compose Patterns into larger solutionsIncomingOrderAuthenticateAuthen ticateDecryptDecryptDe-DupDe-DupPipePipe PipeFilterFilterFilter Clean Order14 Copyright 2003 Gregor HohpeEnterprise Integration PatternsMultiple Specialized ProvidersOrderMessagesWidget Inv.

6 Each provider can only handle specific type of message Route request to the appropriate provider based on the content of the request message Do not want to burden sender with decision (decoupling) Letting each consumer pick out desired messages requires distributed coordination15 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Content-Based RouterOrderMessagesWidget Inv. Insert a Content-Based Router Message routers forward incoming messages to different output channels Message content not changed Mostly stateless, but can be stateful( de-duper)OrderEntryOrderEntryContent-Bas edRouter16 Copyright 2003 Gregor HohpeEnterprise Integration PatternsComposite MessageOrderMessageWidget Inv. How can we process a message if it contains multiple elements, each of which may have to be processed in a different way? Treat each element independently Need to avoid missing or duplicate elements Make efficient use of network resourcesOrderEntryOrderEntry?

7 ?Gadget 2003 Gregor HohpeEnterprise Integration PatternsPattern: SplitterOrderMessageWidget Inv. Use a Splitter to break out the composite message into a series of individual messages, each containing data related to one 1 OrderItem 2??SplitterGadget 2003 Gregor HohpeEnterprise Integration PatternsComposite: Splitter & RouterOrderMessageOrderItem 1 Widget Inv. Use a Splitter to break out the composite message into a series of individual messages, each containing data related to one item. Then use a Content-Based Router to route the individual messages to the proper destinationOrderEntryOrderEntryOrderItem 1 OrderItem 2 SplitterGadget 219 Copyright 2003 Gregor HohpeEnterprise Integration PatternsProducing a Single ResponseWidget 1 OrderItem 2 Response 1 Response 2??ConfirmedOrderBillingBilling How to combine the results of individual, but related messages so that they can be processed as a whole?

8 Messages out of order Message delayed Which messages are related? Avoid separate channel for each system20 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: AggregatorOrderItem 1 Response 1 ConfirmedOrderWidget Inv. Use a statefulfilter, an Aggregator, to collect and store individual messages until a complete set of related messages has been received. Aggregator publishes a single message distilled from the individual messages. Correlation Completeness Condition Aggregation AlgorithmGadget 2 Response 2 BillingBillingAggregator21 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Scatter-Gather Send a message to a dynamic set of recipients, and return a single message that incorporates the responses. QuoteRequest Best QuoteVendor AVendor AVendor BVendor BPub-SubChannelQuoteAggregatorVendor CVendor CScatter-Gather22 Copyright 2003 Gregor HohpeEnterprise Integration PatternsComposing Patterns Receive an order, get best offer for each item from vendors, combine into validated Requestfor each item Best Quotefor each itemVendor AVendor AVendor BVendor BPub-SubChannelQuoteAggregatorVendor CVendor CValidated OrderAggregator23 Copyright 2003 Gregor HohpeEnterprise Integration PatternsSystem Management Messaging systems are asynchronous and distributed Multiple platforms Difficult to detect errors Difficult to configure (property file hell) How can we effectively administer a messaging system that is distributed across multiple platforms and a wide geographic area?

9 24 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Control BusApplication Message FlowControl BusManagementConsole Configuration Heartbeat Test messages Exceptions / logging Statistics / Quality-of-Service (QoS) Live console25 Copyright 2003 Gregor HohpeEnterprise Integration PatternsHow To Inspect Messages?Point-To-Point ChannelSenderSender Cannot add another receiver because it would consume the message Cannot switch to Publish-Subscribe-Channel because may already have Competing ConsumersPoint-To-Point Channel??MessageManagementConsoleReceive rReceiver26 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Wire TapWire TapSenderSenderReceiverReceiver Simple Routerthat duplicates message to two output channels Also known as Tee Some side effects: Message ID changes, latencyMessageMessageManagementConsole27 Copyright 2003 Gregor HohpeEnterprise Integration PatternsTrack MessagesWire TapWire TapAnalysisComponentComponent , message run time, message volume Missed messages if channels or component unreliable28 Copyright 2003 Gregor HohpeEnterprise Integration PatternsWhat if Return Address is Used?

10 ProviderWire TapRequest Channel Provider routes reply message to dynamic channel Cannot dynamically inject Wire TapConsumerConsumer??ConsumerConsumerRep ly Channels29 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Smart Proxy A Smart Proxystores original Return Addressand replaces it with a fixed channel address Intercepts reply messages and forwards them to correct channel Allows analysis of request and reply messagesRequest ChannelProviderSmart ProxyFixed Reply ChannelConsumerConsumerConsumerConsumerR eplyChannels30 Copyright 2003 Gregor HohpeEnterprise Integration PatternsPattern: Test MessageTest MessageInjectorTest MessageSeparator Inject application specific test messages Extract result from regular message flow Compare result against predefined (or computed) 2 TestResult99 Test Data VerifierControl BusTest Data GeneratorManagement Console31 Copyright 2003 Gregor HohpeEnterprise Integration PatternsIn Visual and verbal language to describe Integration solutions Combine Patterns to describe larger solutions No fancy tools whiteboard or PowerPoint No vendor jargon Not a precise specification language ( , see OMG UML Profile for EAI) Not a new methodology Each pattern describes trade-offs and considerations not included in this overview32 Copyright 2003 Gregor HohpeEnterprise Integration PatternsResources Book (late October): Enterprise Integration Patterns Addison-Wesley, 0-321-20068-3 Contact Gregor Hohpe Web Site Pattern catalog Bibliography, related papers


Related search queries