OSB Exception Handling & Logging 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Joey Wong 
Solution Architect 
Oracle Sydney
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Exceptions
Exception Handlers 
Four types of error handlers: 
• Stage 
• Pipeline 
• Route 
• Service 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Guidelines 
• Easier to handle specific errors at lowest 
level. 
• Handle more general default processing of 
errors using higher level error handlers. 
• Good practice to explicitly handle 
anticipated errors in pipeline. 
• Allow service-level handler to manage 
unanticipated errors. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Stage Error Handler 
• Use dedicated stage for each specific part 
of the message flow. 
• Allows very specific types of errors to be 
caught. 
• Enables greater level of control over error 
processing. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Pipeline Error Handler 
• Sites above the stage error handlers. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Exceptions re-thrown in a stage error 
handler will be propagated to the pipeline 
error handler. 
• Request pipeline error handler is typically 
the result of malformed incoming request 
messages of bug in the request path.
Route Error Handler 
• Most errors seen by OSB happen here. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Error handler is responsible for putting 
the fault message back into the SOAP 
body and forwarding the fault to the 
response message flow. 
• Error message should be logged/alerted.
Service Error Handler 
• Always account for unanticipated errors. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Enables unhandled exceptions at the 
stage, pipeline or route level to be caught 
and handled. 
• Should be used for unanticipated errors. 
• Bad practice to use this error handler to 
process all errors.
Common Error Handler 
• Depending on the type of exceptions that can be caught, you may find error handling 
code is duplicated. 
• May be more efficient to write a common error handling service. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Error Behavior 
• Errors are handled differently depending on how the service is called. 
• Do you want to roll the transaction back for an asynchronous proxy? 
• Do you want to send a fault back in response for a synchronous proxy? 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Synchronous Errors 
• Synchronous transports like HTTP must 
contain “Reply - With Failure” action. 
• This send the fault back in the response to 
the consumer. 
• Message flow terminates, no additional 
actions or error handlers will be executed. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Asynchronous Errors 
• Asynchronous transports like JMS must 
contain “Raise Error” action. 
• Similar to a rethrow in Java, causing the 
transaction to be rolled back. 
• Raise Error action will be caught by a 
higher level error handler. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Logging
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Logging Types 
• Log 
• Alerts 
• Report 
<Sept 24, 2014 2:08:33 PM PDT> <Error> <OSB Logging> <Oracle-000000> 
<[PipelinePairNode1, PipelinePairNode1_request, show text info, REQUEST] 
Text contents are: This is the file a.txt END> 
<Sept 24, 2014 2:08:33 PM PDT> <Error> <OSB Logging> <Oracle-000000> 
<[PipelinePairNode1, PipelinePairNode1_request, show text info, REQUEST] 
File name is: ftp_in/a.txt> 
<Sept 24, 2014 2:08:33 PM PDT> <Error> <OSB Logging> <Oracle-000000> 
<[PipelinePairNode1, PipelinePairNode1_request, show text info, REQUEST] 
Text contents are: This is the file b.txt END> 
<Sept 24, 2014 2:08:33 PM PDT> <Error> <OSB Logging> <Oracle-000000> 
< [PipelinePairNode1, PipelinePairNode1_request, show text info, REQUEST] 
File name is: ftp_in/b.txt>
Guidelines 
• Establish logging requirements before starting development. 
• Logging usually doesn’t need to include the entire body of the payload. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Set appropriate logging levels. 
• Error handlers should log at level “Error”. 
• Dedicated OSB log file. 
• Reporting action is heavy on resources. Use sparingly for Audit purposes.

OSB Exception Handling Logging - OFM Canberra September 2014

  • 1.
    OSB Exception Handling& Logging Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Joey Wong Solution Architect Oracle Sydney
  • 2.
    Copyright © 2014Oracle and/or its affiliates. All rights reserved. | Exceptions
  • 3.
    Exception Handlers Fourtypes of error handlers: • Stage • Pipeline • Route • Service Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 4.
    Guidelines • Easierto handle specific errors at lowest level. • Handle more general default processing of errors using higher level error handlers. • Good practice to explicitly handle anticipated errors in pipeline. • Allow service-level handler to manage unanticipated errors. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 5.
    Stage Error Handler • Use dedicated stage for each specific part of the message flow. • Allows very specific types of errors to be caught. • Enables greater level of control over error processing. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 6.
    Pipeline Error Handler • Sites above the stage error handlers. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Exceptions re-thrown in a stage error handler will be propagated to the pipeline error handler. • Request pipeline error handler is typically the result of malformed incoming request messages of bug in the request path.
  • 7.
    Route Error Handler • Most errors seen by OSB happen here. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Error handler is responsible for putting the fault message back into the SOAP body and forwarding the fault to the response message flow. • Error message should be logged/alerted.
  • 8.
    Service Error Handler • Always account for unanticipated errors. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Enables unhandled exceptions at the stage, pipeline or route level to be caught and handled. • Should be used for unanticipated errors. • Bad practice to use this error handler to process all errors.
  • 9.
    Common Error Handler • Depending on the type of exceptions that can be caught, you may find error handling code is duplicated. • May be more efficient to write a common error handling service. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 10.
    Error Behavior •Errors are handled differently depending on how the service is called. • Do you want to roll the transaction back for an asynchronous proxy? • Do you want to send a fault back in response for a synchronous proxy? Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 11.
    Synchronous Errors •Synchronous transports like HTTP must contain “Reply - With Failure” action. • This send the fault back in the response to the consumer. • Message flow terminates, no additional actions or error handlers will be executed. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 12.
    Asynchronous Errors •Asynchronous transports like JMS must contain “Raise Error” action. • Similar to a rethrow in Java, causing the transaction to be rolled back. • Raise Error action will be caught by a higher level error handler. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 13.
    Copyright © 2014Oracle and/or its affiliates. All rights reserved. | Logging
  • 14.
    Copyright © 2014Oracle and/or its affiliates. All rights reserved. | Logging Types • Log • Alerts • Report <Sept 24, 2014 2:08:33 PM PDT> <Error> <OSB Logging> <Oracle-000000> <[PipelinePairNode1, PipelinePairNode1_request, show text info, REQUEST] Text contents are: This is the file a.txt END> <Sept 24, 2014 2:08:33 PM PDT> <Error> <OSB Logging> <Oracle-000000> <[PipelinePairNode1, PipelinePairNode1_request, show text info, REQUEST] File name is: ftp_in/a.txt> <Sept 24, 2014 2:08:33 PM PDT> <Error> <OSB Logging> <Oracle-000000> <[PipelinePairNode1, PipelinePairNode1_request, show text info, REQUEST] Text contents are: This is the file b.txt END> <Sept 24, 2014 2:08:33 PM PDT> <Error> <OSB Logging> <Oracle-000000> < [PipelinePairNode1, PipelinePairNode1_request, show text info, REQUEST] File name is: ftp_in/b.txt>
  • 15.
    Guidelines • Establishlogging requirements before starting development. • Logging usually doesn’t need to include the entire body of the payload. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Set appropriate logging levels. • Error handlers should log at level “Error”. • Dedicated OSB log file. • Reporting action is heavy on resources. Use sparingly for Audit purposes.