[ 
https://issues.apache.org/activemq/browse/SM-1665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46874#action_46874
 ] 

rgavlin edited comment on SM-1665 at 10/29/08 2:27 AM:
----------------------------------------------------------

Based on your suggestion, I modified the wsld-first-cxf-camel-su 
camel-context.xml as listed below. 

As a result I am now seeing the ErrorHandler being invoked as reflected in the 
newly attached smx log file: revised_smx_log_with_new_interceptor_syntax.log.

This is a major step in the right direction. However, there still seems to be a 
few issues that are not quite right.

1. In this example, an <UnknownPersonFault 
xmlns="http://servicemix.apache.org/samples/wsdl-first/types";><personId/></UnknownPersonFault>
 should not be considered an ERROR. However, the excerpt below from the newly 
attached smx.log starting at line 144 indicates to operators monitoring smx 
that an error has indeed occurred. Every redelivery includes this ERROR 
statement in the smx log.

{quote}
04:44:51,379 | ERROR | pool-flow.seda.servicemix-camel-thread-1 | 
DeadLetterChannel        | .apache.camel.processor.Logger  188 | Failed 
delivery for exchangeId: ID-DELL9200/1787-1225269403397/0-0. On delivery 
attempt: 0 caught: org.apache.camel.CamelException: Message contains fault of 
type javax.xml.transform.dom.DOMSource:
[EMAIL PROTECTED]
org.apache.camel.CamelException: Message contains fault of type 
javax.xml.transform.dom.DOMSource:
[EMAIL PROTECTED]
        at 
org.apache.camel.processor.HandleFaultProcessor.process(HandleFaultProcessor.java:36)
        at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:75)
        at 
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
        at 
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
        at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
        at 
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
        at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
        at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
        at 
org.apache.servicemix.camel.CamelProviderEndpoint.handleActiveProviderExchange(CamelProviderEndpoint.java:115)
        at 
org.apache.servicemix.camel.CamelProviderEndpoint.process(CamelProviderEndpoint.java:73)
        at 
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:600)
        at 
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:554)
        at 
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:510)
        at 
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
        at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:620)
        at 
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
        at 
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
        at 
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
{quote}

2. The Error message listed above does not include <UnknownPersonFault/> in its 
content. Instead, it includes an 
org.apache.camel.processor.HandleFaultProcessor stack trace which seems to add 
no value in this case.

3. When the <UnknownPersonFault/> is caught, I would like to be able to 
gracefully handle it. Specifically, I would like to use all the functionality 
available via <onException> & <handled> to handle faults as well as 
error/exceptions. This includes:
a. altering the redeliveryPolicy, in this case setting maxRedeliveries=1 since 
redelivery offers no value
b. optionally setting handled="true" to stop the "fault" message from 
propagating back to the cxf-bc consumer
c. optionally modifying the "out" message via a transform to represent this 
condition to the cxf-bc consumer in a different way


Thanks in advance for your response.

/Ron



========================================
Updated wsld-first-cxf-camel-su camel-context.xml:
========================================
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:person="http://servicemix.apache.org/samples/wsdl-first";
        xsi:schemaLocation="
       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://activemq.apache.org/camel/schema/spring 
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
    ">

        <camelContext id="camel"
                xmlns="http://activemq.apache.org/camel/schema/spring";>
                <route errorHandlerRef="deadLetterErrorHandler">
                        <from 
uri="jbi:service:http://servicemix.apache.org/samples/wsdl-first/PersonServiceProviderHandler";
 />
            <interceptor ref="handleFaultProcessor">
                <to 
uri="jbi:service:http://servicemix.apache.org/samples/wsdl-first/PersonServiceProvider?mep=in-out";
 />
            </interceptor>
                </route>
        </camelContext>
        
        <bean id="deadLetterErrorHandler" 
class="org.apache.camel.builder.DeadLetterChannelBuilder">
                <property name="redeliveryPolicy" ref="redeliveryPolicyConfig" 
/>
        </bean>
        
        <bean id="redeliveryPolicyConfig" 
class="org.apache.camel.processor.RedeliveryPolicy">
                <property name="maximumRedeliveries" value="3" />
                <property name="initialRedeliveryDelay" value="2000" />
                <property name="useExponentialBackOff" value="true" />
                <property name="backOffMultiplier" value="2" />
        </bean>

    <bean id="handleFaultProcessor" 
class="org.apache.camel.processor.HandleFaultProcessor" />

</beans>
{code}

      was (Author: rgavlin):
    Based on your suggestion, I modified the wsld-first-cxf-camel-su 
camel-context.xml as listed below. 

As a result I am now seeing the ErrorHandler being invoked as reflected in the 
newly attached smx log file: revised_smx_log_with_new_interceptor_syntax.log.

This is a major step in the right direction. However, there still seems to be a 
few issues that are not quite right.

1. In this example, an <UnknownPersonFault 
xmlns="http://servicemix.apache.org/samples/wsdl-first/types";><personId/></UnknownPersonFault>
 should not be considered an ERROR. However, the excerpt below from the newly 
attached smx.log starting at line 144 indicates to operators monitoring smx 
that an error has indeed occurred. Every redelivery includes this ERROR 
statement in the smx log.

04:44:51,379 | ERROR | pool-flow.seda.servicemix-camel-thread-1 | 
DeadLetterChannel        | .apache.camel.processor.Logger  188 | Failed 
delivery for exchangeId: ID-DELL9200/1787-1225269403397/0-0. On delivery 
attempt: 0 caught: org.apache.camel.CamelException: Message contains fault of 
type javax.xml.transform.dom.DOMSource:
[EMAIL PROTECTED]
org.apache.camel.CamelException: Message contains fault of type 
javax.xml.transform.dom.DOMSource:
[EMAIL PROTECTED]
        at 
org.apache.camel.processor.HandleFaultProcessor.process(HandleFaultProcessor.java:36)
        at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:75)
        at 
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
        at 
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
        at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
        at 
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
        at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
        at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
        at 
org.apache.servicemix.camel.CamelProviderEndpoint.handleActiveProviderExchange(CamelProviderEndpoint.java:115)
        at 
org.apache.servicemix.camel.CamelProviderEndpoint.process(CamelProviderEndpoint.java:73)
        at 
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:600)
        at 
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:554)
        at 
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:510)
        at 
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
        at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:620)
        at 
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
        at 
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
        at 
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)

2. The Error message listed above does not include <UnknownPersonFault/> in its 
content. Instead, it includes an 
org.apache.camel.processor.HandleFaultProcessor stack trace which seems to add 
no value in this case.

3. When the <UnknownPersonFault/> is caught, I would like to be able to 
gracefully handle it. Specifically, I would like to use all the functionality 
available via <onException> & <handled> to handle faults as well as 
error/exceptions. This includes:
a. altering the redeliveryPolicy, in this case setting maxRedeliveries=1 since 
redelivery offers no value
b. optionally setting handled="true" to stop the "fault" message from 
propagating back to the cxf-bc consumer
c. optionally modifying the "out" message via a transform to represent this 
condition to the cxf-bc consumer in a different way


Thanks in advance for your response.

/Ron



========================================
Updated wsld-first-cxf-camel-su camel-context.xml:
========================================
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:person="http://servicemix.apache.org/samples/wsdl-first";
        xsi:schemaLocation="
       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://activemq.apache.org/camel/schema/spring 
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
    ">

        <camelContext id="camel"
                xmlns="http://activemq.apache.org/camel/schema/spring";>
                <route errorHandlerRef="deadLetterErrorHandler">
                        <from 
uri="jbi:service:http://servicemix.apache.org/samples/wsdl-first/PersonServiceProviderHandler";
 />
            <interceptor ref="handleFaultProcessor">
                <to 
uri="jbi:service:http://servicemix.apache.org/samples/wsdl-first/PersonServiceProvider?mep=in-out";
 />
            </interceptor>
                </route>
        </camelContext>
        
        <bean id="deadLetterErrorHandler" 
class="org.apache.camel.builder.DeadLetterChannelBuilder">
                <property name="redeliveryPolicy" ref="redeliveryPolicyConfig" 
/>
        </bean>
        
        <bean id="redeliveryPolicyConfig" 
class="org.apache.camel.processor.RedeliveryPolicy">
                <property name="maximumRedeliveries" value="3" />
                <property name="initialRedeliveryDelay" value="2000" />
                <property name="useExponentialBackOff" value="true" />
                <property name="backOffMultiplier" value="2" />
        </bean>

    <bean id="handleFaultProcessor" 
class="org.apache.camel.processor.HandleFaultProcessor" />

</beans>
  
> smx-camel errorHandler w/handleFault="true" does not "handle" JBIFault thrown 
> by smx-cxf-bc provider
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SM-1665
>                 URL: https://issues.apache.org/activemq/browse/SM-1665
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-camel
>    Affects Versions: servicemix-camel-2008.01
>         Environment: Proposed 3.3 release 
> (http://people.apache.org/~ffang/servicemix3.3-2nd-try/) 
> with smx-camel-2008.01 component patched to include camel-core-1.5.0.jar and 
> camel-spring-1.5.0.jar 
> from 
> http://people.apache.org/~hadrian/apache-camel-1.5.0-RC1/maven2/org/apache/camel/apache-camel/1.5.0/apache-camel-1.5.0.zip.
>            Reporter: Ron Gavlin
>            Assignee: Gert Vanthienen
>         Attachments: cxf-wsdl-first-http2jmsbridge-camelerrorhandler.zip, 
> revised_smx_log_with_new_interceptor_syntax.log, 
> servicemix-camel-2008.01-updated-installer.zip, servicemix.log
>
>
> I have a variant of the cxf-wsdl-first example that includes a smx-cxf-bc 
> (in-out) consumer <-> smx-camel errorHandler w/handleFault="true" <-> 
> smx-cxf-bc (in-out) provider <-> JMS BROKER <-> smx-cxf-bc (in-out) consumer 
> <-> smx-cxf-se.
> I use client.html to send a request with no personId which triggers the 
> smx-cxf-se PersonImpl class to throw an UnknownPersonFault. The smx-camel 
> errorHandler does not intercept the JBIFault and redeliver as expected.
> I have attached a test case, my patched 
> servicemix-camel-2008.01-updated-installer.zip, and the corresponding 
> servicemix.log. In order to exercise the test, 
> 1. deploy wsdl-first-cxf-sa-3.3.zip from the test case archive
> 2. open client.html from the test case archive in a browser, delete the 
> personId value, then click send.
> 3. notice that the camel errorHandler performs no redeliveries

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to