You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Trevor Pounds (JIRA)" <ji...@apache.org> on 2009/06/15 22:50:35 UTC
[jira] Created: (SMXCOMP-570) Allow exceptions to be handled as JBI
faults
Allow exceptions to be handled as JBI faults
--------------------------------------------
Key: SMXCOMP-570
URL: https://issues.apache.org/activemq/browse/SMXCOMP-570
Project: ServiceMix Components
Issue Type: New Feature
Components: servicemix-common
Reporter: Trevor Pounds
Attachments: SMXCOMP-125.diff
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:
{code:xml}
<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>
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SMXCOMP-570) Allow exceptions to be handled as JBI
faults
Posted by "Trevor Pounds (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SMXCOMP-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Trevor Pounds updated SMXCOMP-570:
----------------------------------
Attachment: SMXCOMP-125.diff
> Allow exceptions to be handled as JBI faults
> --------------------------------------------
>
> Key: SMXCOMP-570
> URL: https://issues.apache.org/activemq/browse/SMXCOMP-570
> Project: ServiceMix Components
> Issue Type: New Feature
> Components: servicemix-common
> Reporter: Trevor Pounds
> Attachments: SMXCOMP-125.diff
>
>
> 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:
> {code:xml}
> <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>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SMXCOMP-570) Allow exceptions to be handled as JBI
faults
Posted by "Trevor Pounds (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SMXCOMP-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Trevor Pounds updated SMXCOMP-570:
----------------------------------
Attachment: (was: SMXCOMP-125.diff)
> Allow exceptions to be handled as JBI faults
> --------------------------------------------
>
> Key: SMXCOMP-570
> URL: https://issues.apache.org/activemq/browse/SMXCOMP-570
> Project: ServiceMix Components
> Issue Type: New Feature
> Components: servicemix-common
> Reporter: Trevor Pounds
> Attachments: SMXCOMP-125.diff
>
>
> 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:
> {code:xml}
> <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>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SMXCOMP-570) Allow exceptions to be handled as JBI
faults
Posted by "Trevor Pounds (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SMXCOMP-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Trevor Pounds updated SMXCOMP-570:
----------------------------------
Attachment: SMXCOMP-125.diff
attaching patch against ServiceMix 3.3.1.8-fuse release
> Allow exceptions to be handled as JBI faults
> --------------------------------------------
>
> Key: SMXCOMP-570
> URL: https://issues.apache.org/activemq/browse/SMXCOMP-570
> Project: ServiceMix Components
> Issue Type: New Feature
> Components: servicemix-common
> Reporter: Trevor Pounds
> Attachments: SMXCOMP-125.diff
>
>
> 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:
> {code:xml}
> <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>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SMXCOMP-570) Allow exceptions to be handled as
JBI faults
Posted by "Trevor Pounds (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SMXCOMP-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52274#action_52274 ]
Trevor Pounds commented on SMXCOMP-570:
---------------------------------------
I would also like to note that this patch provides generic functionality for all provider endpoints so long as they do not override the process() method on the ProviderEndpoint base class. The classes that do this should be add an additional try/catch block that handles the exception using the super classes handleException() method as it is done for the EIP endpoint in the attached patch. It may be beneficial to refactor the ProviderEndpoint interface to not allow classes to override this method and instead provide hooks to handle different MEPs from within the base class.
> Allow exceptions to be handled as JBI faults
> --------------------------------------------
>
> Key: SMXCOMP-570
> URL: https://issues.apache.org/activemq/browse/SMXCOMP-570
> Project: ServiceMix Components
> Issue Type: New Feature
> Components: servicemix-common
> Reporter: Trevor Pounds
> Attachments: SMXCOMP-125.diff
>
>
> 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:
> {code:xml}
> <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>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SMXCOMP-570) Allow exceptions to be handled as JBI
faults
Posted by "Trevor Pounds (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SMXCOMP-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Trevor Pounds updated SMXCOMP-570:
----------------------------------
Attachment: (was: SMXCOMP-125.diff)
> Allow exceptions to be handled as JBI faults
> --------------------------------------------
>
> Key: SMXCOMP-570
> URL: https://issues.apache.org/activemq/browse/SMXCOMP-570
> Project: ServiceMix Components
> Issue Type: New Feature
> Components: servicemix-common
> Reporter: Trevor Pounds
>
> 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:
> {code:xml}
> <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>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SMXCOMP-570) Allow exceptions to be handled as JBI
faults
Posted by "Trevor Pounds (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SMXCOMP-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Trevor Pounds updated SMXCOMP-570:
----------------------------------
Attachment: SMXCOMP-125.diff
attaching more complete patch with exception handling in eip endpoint
> Allow exceptions to be handled as JBI faults
> --------------------------------------------
>
> Key: SMXCOMP-570
> URL: https://issues.apache.org/activemq/browse/SMXCOMP-570
> Project: ServiceMix Components
> Issue Type: New Feature
> Components: servicemix-common
> Reporter: Trevor Pounds
> Attachments: SMXCOMP-125.diff
>
>
> 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:
> {code:xml}
> <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>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.