WELCOME                                                                  Effective Fault Handling in                      ...
Guido Schmutz•   Working for Trivadis for more than 15 years•   Oracle ACE Director for Fusion Middleware and SOA•   Co-Au...
Ronald van Luttikhuizen•   Managing Partner at Vennster•   Oracle ACE Director for Fusion Middleware and SOA•   Author of ...
Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation o...
Error/Fault Handling•   The goal of every programmer should be to write unbreakable software•   Extent of achievement depe...
What is a Fault ? Something outside normal operational activity or “happy flow”  happened     Technical error     Progr...
Two Types of FaultsBusiness faults Faults that service clients can expect and recover from Failure to meet a particular ...
Business Fault<wsdl:operation name=“orderProduct”> <wsdl:input message=“order:OrderProductRequestMessage"/> <wsdl:output m...
Business Fault (II) <soap:Envelope>                                                                    3. Actual service r...
Technical Fault<wsdl:operation name=“orderProduct”> <wsdl:input message=“order:OrderProductMessage"/> <wsdl:output message...
Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation o...
Fault Handling SOA vs. traditional                                                                Higher degree of complex...
Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation o...
Scenario (Areas of Problems/Faults)                                                                                     Ol...
Fault Recovery StrategiesInaction – ignore the requestBalk – admit failureGuarded suspension – suspend execution until con...
Fault Recovery StrategiesRollback – try to proceed, but on failure, undo the effects of a failedactionRetry – repeatedly a...
Patterns for Fault Tolerant SoftwareCompensationException shielding(Limit) RetryShare the loadAlternativeException handler...
Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation o...
Implementation of Scenario           2011 © Trivadis, Vennster           Effective Fault Handling in Oracle SOA Suite 11g ...
Product ManagementResult Caching      Result CacheProblem Not to overload the old, non-scalable product system with the n...
Product ManagementResult CachingResults are returned from cache rather than invoking alwaysthe external service Product d...
Product ManagementService Throttlingrestricts the number of messages on the message flow to abusiness service             ...
Credit Card BookingRetry Configuration           RetryProblem Unstable network between us and the external servicesSoluti...
Credit Card BookingRetry ConfigurationConfigured on the business service in OSB                                           ...
Credit Card BookingService Pooling                 Service PoolingProblem Visa Service does not guarantee 7*24 availabili...
Credit Card BookingService Pooling                                                               Visa Service 1   Proxy   ...
Order ManagementTransaction configuration                                                                 Transaction of O...
Order Management (II) Fault Message on Callback ContractFault Message onCallback Contract Problem  Need to return a Produ...
Order Management (II)Fault Message on Callback Contract“Business Fault” modeled as another operation on the  Callback WSDL...
Order HistoryFault Management Framework   Use Fault Policy Management   In Mediator to configure retryProblem Order Histo...
Order HistoryFault Management Framework<faultPolicyBindings version="2.0.1"  <composite faultPolicy=“OrdderProcessingFault...
Order Handling ProcessReturn Errors as synchronous response                                  Problem                      ...
Order Handling ProcessReturn Errors as synchronous responseHandle Business Faults in BPEL error handler and reply with ane...
Order Handling Process (II)Handle missing callback message with timeout                                Problem            ...
Order Handling Process (II)Handle missing callback message with timeoutPick Activity for handling callbackmessage with tim...
Order Handling Process (III)Compensation Handling                                   Problem                               ...
Order Handling Process (III)Compensation HandlingCompensate activity invokes compensationhandling on the inner scope• Can ...
Order Handling Process (V)Generic Error Handler w. Fault Policy Framework                                         Problem ...
Order Handling Process (V)Generic Error Handler w. Fault Policy FrameworkExplanation and demo of generic fault handler    ...
Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation o...
SummaryIssue                                                                    Solution                         ProductOv...
Summary & Best PracticesDifferentiate between business and technical faultsDesign service contracts with faults in mind: f...
Thank You!                                                                                  Trivadis AG                   ...
Upcoming SlideShare
Loading in...5
×

UKOUG 2011 - Effective Fault Handling in Oracle SOA Suite 11g

7,052

Published on

Slides for the "Effective Fault Handling in Oracle SOA Suite 11g" session at UKOUG2011 conference in Birmingham.

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
7,052
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

UKOUG 2011 - Effective Fault Handling in Oracle SOA Suite 11g

  1. 1. WELCOME Effective Fault Handling in Oracle SOA Suite 11g Guido Schmutz (Trivadis) Ronald van Luttikhuizen (Vennster) UKOUG Conference 2011 6.12.2011BASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN 2011 © Trivadis, Vennster 1 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  2. 2. Guido Schmutz• Working for Trivadis for more than 15 years• Oracle ACE Director for Fusion Middleware and SOA• Co-Author of different books• Consultant, Trainer Software Architect for Java, Oracle, SOA and EDA• Member of Trivadis Architecture Board• Technology Manager @ Trivadis• More than 20 years of software development experience• Contact: guido.schmutz@trivadis.com• Blog: http://guidoschmutz.wordpress.com• Twitter: gschmutz 2011 © Trivadis, Vennster
  3. 3. 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 2011 © Trivadis, Vennster
  4. 4. Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation of Scenario5. Summary and Best Practices 2011 © Trivadis, Vennster4 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  5. 5. Error/Fault Handling• The goal of every programmer should be to write unbreakable software• Extent of achievement depends on how good expected and unexpected exception conditions are handled and managed• Object-oriented languages such as C++ and Java provide an efficient way for handling exceptions using constructs such as try, catch, and finally.• With a SOA, most of what is available at language level is still valid and usable• SOA raises different challenges once starting orchestrating services and creating composite applications• Prevention vs. handling 2011 © Trivadis, Vennster5 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  6. 6. What is a Fault ? Something outside normal operational activity or “happy flow” happened  Technical error  Programming error  Faulty operation by user  Exceptional business behavior 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  7. 7. Two Types of FaultsBusiness faults Faults that service clients can expect and recover from Failure to meet a particular business requirement Often: expected, business value, contractual and recoverableTechnical faults Faults that service clients do not expect and cannot (easily) recover from Results of unexpected errors during runtime, e.g. null pointer errors, resources not available, and so on Often: unexpected, technical, implementation and non-recoverable 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  8. 8. Business Fault<wsdl:operation name=“orderProduct”> <wsdl:input message=“order:OrderProductRequestMessage"/> <wsdl:output message=“order:OrderProductResponseMessage"/> <wsdl:fault message=“order:ProductNotInStockFaultMessage" 1. Service contract including fault name=“ProductNotInStockFault"/> <wsdl:fault message=“order:CustomerNotFoundFaultMessage" name=“CustomerNotFoundFault"/></wsdl:operation><xsd:element name=“CustomerNotFoundFaultMessage”> <xsd:complexType> <xsd:sequence> 2. Fault message payload <xsd:element name=“CustName” type=“xsd:string”/> <xsd:element name=“City” type=“xsd:string”/> </xsd:sequence> </xsd:complexType></xsd:element> 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  9. 9. Business Fault (II) <soap:Envelope> 3. Actual service response <soap:Header/> <soap:Body> <soap:Fault> <faultcode>CST-1234</faultcode> <faultstring>Customer not found</faultstring> <detail> <CustomerNotFoundFault> <CustName>John Doe</CustName> <City>Long Beach</City> </CustomerNotFoundFault> </detail> </soap:Fault> </soap:Body> </soap:Envelope> 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  10. 10. Technical Fault<wsdl:operation name=“orderProduct”> <wsdl:input message=“order:OrderProductMessage"/> <wsdl:output message=“order:OrderProductResponseMessage"/> <wsdl:fault message=“order:ProductNotInStockFaultMessage" name=“ProductNotInStockFault"/> 1. Service contract <wsdl:fault message=“order:CustomerNotFoundFaultMessage" including fault name=“CustomerNotFoundFault"/></wsdl:operation> 2. Actual service response<soap:Envelope> <soap:Header/> <soap:Body> <soap:Fault> <faultcode>S:Server</faultcode> <faultstring>Could not connect to URL 127.0.0.1 on port 8001</faultstring> </soap:Fault> </soap:Body></soap:Envelope> 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  11. 11. Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation of Scenario5. Summary and Best Practices 2011 © Trivadis, Vennster11 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  12. 12. Fault Handling SOA vs. traditional Higher degree of complexity BPM/BPEL User Interface Multiple service consumers Services part of larger unit Heterogeneous & external ESB components Long running processes Implemen- Implemen- Implemen- Asynchronous tation tation tation Timed events Often enterprise-wide Transactions 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  13. 13. Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation of Scenario5. Summary and Best Practices 2011 © Trivadis, Vennster13 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  14. 14. Scenario (Areas of Problems/Faults) Old System with limited scalability Short Network interruptions No 7*24 avail. for single instance ofSync vs Async visa Processing Only reachable by queuing Response sometimes get lost Fault if product is no longer avail Not always available 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  15. 15. Fault Recovery StrategiesInaction – ignore the requestBalk – admit failureGuarded suspension – suspend execution until conditions for correctexecution are establishedProvisional action – pretend to perform the request, but do not commituntil success is grantedRecovery – perform an acceptable alternative 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  16. 16. Fault Recovery StrategiesRollback – try to proceed, but on failure, undo the effects of a failedactionRetry – repeatedly attempt a failed action after recovering from failedattemptsAppeal to higher authority – ask someone to apply judgment andsteer the software to an acceptable resolutionResign – Minimize damage, write log information, then signal definite andsafe failure 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  17. 17. Patterns for Fault Tolerant SoftwareCompensationException shielding(Limit) RetryShare the loadAlternativeException handlerHeartbeatThrottling 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  18. 18. Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation of Scenario5. Summary and Best Practices 2011 © Trivadis, Vennster19 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  19. 19. Implementation of Scenario 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  20. 20. Product ManagementResult Caching Result CacheProblem Not to overload the old, non-scalable product system with the new demandSolution Use Result Caching to cache the product information (read-only operation) Use Service Throttling to limit the number of concurrent requests 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  21. 21. Product ManagementResult CachingResults are returned from cache rather than invoking alwaysthe external service Product data is rather static, so ideal candidate for caching Proxy Business 1 Product DB Service Service 2 3 Result Cache OSB 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  22. 22. Product ManagementService Throttlingrestricts the number of messages on the message flow to abusiness service Message Buffer Proxy Business Product Service Service DBOSB Set from Operational Settings on the OSB console 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  23. 23. Credit Card BookingRetry Configuration RetryProblem Unstable network between us and the external servicesSolution Use Retry mechanism of OSB to try many times No Fault Management necessary for service consumer if network interruption is only for a short time 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  24. 24. Credit Card BookingRetry ConfigurationConfigured on the business service in OSB 1 Proxy Business after 2s Visa Service Service Service 2OSB 5x 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  25. 25. Credit Card BookingService Pooling Service PoolingProblem Visa Service does not guarantee 7*24 availability for one single instanceSolution Use the multiple instances (endpoints) visa provides and use service pooling feature of OSB No Fault Management for the service consumer if at least one endpoint is available 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  26. 26. Credit Card BookingService Pooling Visa Service 1 Proxy Business Visa Service 2 Service ServiceOSB Visa Service 3 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  27. 27. Order ManagementTransaction configuration Transaction of OSB Service Consumer Transaction of OSB Service ConsumerProblem Guarantee that the message will be delivered to the order management systemSolution Make sure that queues are available, even if the Handle Order system is not Make sure that queuing run‟s in the same transaction as the service consumer 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  28. 28. Order Management (II) Fault Message on Callback ContractFault Message onCallback Contract Problem  Need to return a Product No Longer Available Business Fault over an Asynchronous MEP Solution  Design a separate Fault Message and Operation on the Callback contract (WSDL) and use that 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  29. 29. Order Management (II)Fault Message on Callback Contract“Business Fault” modeled as another operation on the Callback WSDL 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  30. 30. Order HistoryFault Management Framework Use Fault Policy Management In Mediator to configure retryProblem Order History System not available should have no impact on Business ProcessSolution Use Mediator with Fault Management Framework to configure retry independent of availability of Order History Web Service 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  31. 31. Order HistoryFault Management Framework<faultPolicyBindings version="2.0.1" <composite faultPolicy=“OrdderProcessingFaults"/></faultPolicyBindings><faultPolicies> <faultPolicy version="2.0.1" id=“OrderProcessingFaults“...> <Conditions> <action ref=“ora-retry”/> </Conditions> <Actions> <Action id="ora-retry"> <Retry> <retryCount>3</retryCount> <retryInterval>2</retryInterval> <exponentialBackoff/> <retryFailureAction ref="ora-java"/> <retrySuccessAction ref="ora-java"/> </Retry> </Action> </Actions> </faultPolicy></faultPolicies> © Trivadis, Vennster 2011 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  32. 32. Order Handling ProcessReturn Errors as synchronous response Problem  Both Product Management and Credit Card Booking Fault Handling can return Business Faults Solution Fault Handling  Handle errors and map them to errors returned to theReply with Fault service consumer (i.e. the caller of the process)  After that process changes from synchronous to asynchronous 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  33. 33. Order Handling ProcessReturn Errors as synchronous responseHandle Business Faults in BPEL error handler and reply with anerror 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  34. 34. Order Handling Process (II)Handle missing callback message with timeout Problem  Order Processing Response Message can get lost in the Order Processing system, i.e. the callback message will never arrive in BPEL Solution  Timeout on the Wait For Answer with a BPEL pick activity with a timeout Pick with timeout  Undo the process by doing compensation  Use the BPEL compensate activity together with Compensate compensation handler to undo the Booking of the Credit Card 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  35. 35. Order Handling Process (II)Handle missing callback message with timeoutPick Activity for handling callbackmessage with timeout branch c 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  36. 36. Order Handling Process (III)Compensation Handling Problem  Order Processing Callback Message can be a Product No Longer Available Business Fault Compensation Handler Solution  Undo the process by doing compensation  Use the BPEL compensate activity together with compensation handler to undo the Booking of the Credit Card Handle Business Fault and Compensate 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  37. 37. Order Handling Process (III)Compensation HandlingCompensate activity invokes compensationhandling on the inner scope• Can only be invoked from within a fault handler or another compensation handler 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  38. 38. Order Handling Process (V)Generic Error Handler w. Fault Policy Framework Problem  Unexpected (technical) fault  Multiple processes deal with unexpected faults in their own wayUnexpected (technical) error Solution  Use fault handler mechanism to enqueue on error queue without adding process logic  Create one process to listen to error queue and handle faults  Retrieve process information by using (composite) sensors 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  39. 39. Order Handling Process (V)Generic Error Handler w. Fault Policy FrameworkExplanation and demo of generic fault handler 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  40. 40. Agenda1. What is Fault Handling2. Fault Handling in SOA vs. traditional systems3. Scenario and Patterns4. Implementation of Scenario5. Summary and Best Practices 2011 © Trivadis, Vennster43 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  41. 41. SummaryIssue Solution ProductOverloading product management system ThrottlingResult cache OSBVisa Service does not guarantee 7*24 uptime Muliple endpoints OSBdue to e.g. network problems Service poolingGuarantee message delivery to order Availability of queues OSB (and SOA Suitemanagement system Enqueue and dequeue in for XA propagation to service consumer transaction OSB)Returning business fault over async MEP from Separate operation and fault OSB and SOA Suiteorder management system message (callback contract between the two)Order history service not available Retry in Mediator using fault SOA Suite policy frameworkBusiness fault handling from service to process Catch faults in process and OSB and SOA Suiteto consumer reply fault to consumer (correct contracts)Detect missing response message Timeout in pick activity SOA SuiteHandle product no longer available Compensation SOA SuiteAvoid calling credit card booking twice Set non-idempotent property SOA SuiteProcesses needing to deal with unexpected Fault policy frameworks, error SOA Suitetechnical faults. All processes solving it in their queue, generic error handler &own way using process logic. (composite sensors. 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  42. 42. Summary & Best PracticesDifferentiate between business and technical faultsDesign service contracts with faults in mind: formally describe businessfaults in service contractsDon„t use exceptions as goto‟sDesign with criticality, likeliness to fail, and cost in mindDifferentiate fault patterns in OSB and BPM/BPEL: OSB: Retry, Throttling, transactions BPM/BPEL: Compensation, business fault handling, generic fault handler, timeoutHandle unexpected errors genericallyMake services autonomousFault-handling on scope of services and in wider perspective 2011 © Trivadis, Vennster Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011
  43. 43. Thank You! Trivadis AG Guido Schmutz guido.schmutz@trivadis.com Vennster Ronald van Luttikhuizen ronald.van.luttikhuizen@vennster.nlBASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN 2011 © Trivadis, Vennster 46 Effective Fault Handling in Oracle SOA Suite 11g 06.12.2011

×