Uploaded image for project: 'ServiceMix Components'
  1. ServiceMix Components
  2. SMXCOMP-570

Allow exceptions to be handled as JBI faults

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2013.02
    • Component/s: servicemix-common
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      When an exception is thrown in a provider endpoint impl it is handled as a JBI error in most cases. Howeverm in some cases (i.e. SAXParseException) it may be useful to translate these exceptions into a JBI fault message which can then be handled by the exchange if needed. I've provided a simple patch to the base ProviderEndpoint class to provide setting exceptiosn that will be handled as JBI faults.

      The following are a few examples of how the xbean.xml can be configured to handle exceptions:

      <saxon:xslt
         service="example:myService"
         endpoint="myXSLT"
         resource="classpath:myDocument.xsl"
         handleExceptionsAsFault="java.lang.Exception"/>
      
      
      <eip:message-filter
         service="example:myService"
         endpoint="myEIP"
         handleExceptionsAsFault="java.lang.Exception">
         <eip:target>
            <eip:exchange-target service="canonical:mte-pipeline" endpoint=""/>
         </eip:target>
         <eip:filter>
            <eip:xpath-predicate xpath="not(/FOO or /BAR)" namespaceContext="#nsContext"/>
         </eip:filter>
      </eip:message-filter>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tpounds Trevor Pounds
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: