Mule
  1. Mule
  2. MULE-5438

default-exception-strategy within a flow doesn't work as expected

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Won't Fix or Usage Issue
    • Affects Version/s: 3.1.0
    • Fix Version/s: None
    • Component/s: Core: Configuration
    • Labels:
      None
    • Environment:

      JDK 1.6, Mule 3.1.0, MYSQL 5.5, Mule IDE-Eclipse Helios

    • User impact:
      High
    • Configuration:
      Hide

      Config1:
      <spring:beans>
      <spring:bean id="mysql5.5-localDS"
      class="org.enhydra.jdbc.standard.StandardDataSource">
      <spring:property name="driverName" value="$

      {jdbc.driverclass}" />
      <spring:property name="url"
      value="${jdbc.url}" />
      <spring:property name="user" value="${jdbc.user}" />
      <spring:property name="password" value="${jdbc.password}" />
      </spring:bean>
      </spring:beans>

      <jdbc:connector name="mysql5.5-local" dataSource-ref="mysql5.5-localDS">
      <jdbc:query key="insertTransaction"
      value="INSERT INTO MASTER_TRANSACTION
      (SENDER_ID,PARTNER_TRANS_ID, REQUEST_TYPE) VALUES (#[map-payload:SENDER_ID],'100','P2P')" />
      </jdbc:connector>

      <flow name="PassThroughServiceFlow">

      <inbound-endpoint address="http://localhost:8080/ws/SampleService"
      exchange-pattern="request-response">
      <byte-array-to-string-transformer/>
      </inbound-endpoint>

      <flow-ref name="DB"/>

      <default-exception-strategy>
      <logger message="Error in PassThroughServiceFlow"/>
      </default-exception-strategy>

      </flow>

      <flow name="DB">
      <jdbc:outbound-endpoint queryKey="insertTransaction"
      exchange-pattern="request-response">

      <transformer ref="RequestXMLJdbc"/>
      <mule-xml:dom-to-xml-transformer/>
      <transformer ref="xml2maps"/>

      <response>
      <jdbc:maps-to-xml-transformer/>
      </response>
      </jdbc:outbound-endpoint>

      <default-exception-strategy>
      <logger message="DB Error"/>
      </default-exception-strategy>
      </flow>


      Config2:
      <spring:beans>
      <spring:bean id="mysql5.5-localDS"
      class="org.enhydra.jdbc.standard.StandardDataSource">
      <spring:property name="driverName" value="${jdbc.driverclass}

      " />
      <spring:property name="url"
      value="$

      {jdbc.url}

      " />
      <spring:property name="user" value="$

      {jdbc.user}

      " />
      <spring:property name="password" value="$

      {jdbc.password}

      " />
      </spring:bean>
      </spring:beans>

      <jdbc:connector name="mysql5.5-local" dataSource-ref="mysql5.5-localDS">
      <jdbc:query key="insertTransaction"
      value="INSERT INTO MASTER_TRANSACTION
      (SENDER_ID,PARTNER_TRANS_ID, REQUEST_TYPE) VALUES (#[map-payload:SENDER_ID],'100','P2P')" />
      </jdbc:connector>
      <flow name="PassThroughServiceFlow">

      <inbound-endpoint address="http://localhost:8080/ws/SampleService"
      exchange-pattern="request-response">
      <byte-array-to-string-transformer/>
      </inbound-endpoint>

      <wire-tap>
      <flow-ref name="DB"/>
      </wire-tap>

      <echo-component/>

      <default-exception-strategy>
      <logger message="Error in PassThroughServiceFlow"/>
      </default-exception-strategy>

      </flow>

      <flow name="DB">
      <jdbc:outbound-endpoint queryKey="insertTransaction"
      exchange-pattern="request-response">

      <transformer ref="RequestXMLJdbc"/>
      <mule-xml:dom-to-xml-transformer/>
      <transformer ref="xml2maps"/>

      <response>
      <jdbc:maps-to-xml-transformer/>
      </response>
      </jdbc:outbound-endpoint>

      <default-exception-strategy>
      <logger message="DB Error"/>
      </default-exception-strategy>
      </flow>

      Show
      Config1: <spring:beans> <spring:bean id="mysql5.5-localDS" class="org.enhydra.jdbc.standard.StandardDataSource"> <spring:property name="driverName" value="$ {jdbc.driverclass}" /> <spring:property name="url" value="${jdbc.url}" /> <spring:property name="user" value="${jdbc.user}" /> <spring:property name="password" value="${jdbc.password}" /> </spring:bean> </spring:beans> <jdbc:connector name="mysql5.5-local" dataSource-ref="mysql5.5-localDS"> <jdbc:query key="insertTransaction" value="INSERT INTO MASTER_TRANSACTION (SENDER_ID,PARTNER_TRANS_ID, REQUEST_TYPE) VALUES (# [map-payload:SENDER_ID] ,'100','P2P')" /> </jdbc:connector> <flow name="PassThroughServiceFlow"> <inbound-endpoint address="http://localhost:8080/ws/SampleService" exchange-pattern="request-response"> <byte-array-to-string-transformer/> </inbound-endpoint> <flow-ref name="DB"/> <default-exception-strategy> <logger message="Error in PassThroughServiceFlow"/> </default-exception-strategy> </flow> <flow name="DB"> <jdbc:outbound-endpoint queryKey="insertTransaction" exchange-pattern="request-response"> <transformer ref="RequestXMLJdbc"/> <mule-xml:dom-to-xml-transformer/> <transformer ref="xml2maps"/> <response> <jdbc:maps-to-xml-transformer/> </response> </jdbc:outbound-endpoint> <default-exception-strategy> <logger message="DB Error"/> </default-exception-strategy> </flow> Config2: <spring:beans> <spring:bean id="mysql5.5-localDS" class="org.enhydra.jdbc.standard.StandardDataSource"> <spring:property name="driverName" value="${jdbc.driverclass} " /> <spring:property name="url" value="$ {jdbc.url} " /> <spring:property name="user" value="$ {jdbc.user} " /> <spring:property name="password" value="$ {jdbc.password} " /> </spring:bean> </spring:beans> <jdbc:connector name="mysql5.5-local" dataSource-ref="mysql5.5-localDS"> <jdbc:query key="insertTransaction" value="INSERT INTO MASTER_TRANSACTION (SENDER_ID,PARTNER_TRANS_ID, REQUEST_TYPE) VALUES (# [map-payload:SENDER_ID] ,'100','P2P')" /> </jdbc:connector> <flow name="PassThroughServiceFlow"> <inbound-endpoint address="http://localhost:8080/ws/SampleService" exchange-pattern="request-response"> <byte-array-to-string-transformer/> </inbound-endpoint> <wire-tap> <flow-ref name="DB"/> </wire-tap> <echo-component/> <default-exception-strategy> <logger message="Error in PassThroughServiceFlow"/> </default-exception-strategy> </flow> <flow name="DB"> <jdbc:outbound-endpoint queryKey="insertTransaction" exchange-pattern="request-response"> <transformer ref="RequestXMLJdbc"/> <mule-xml:dom-to-xml-transformer/> <transformer ref="xml2maps"/> <response> <jdbc:maps-to-xml-transformer/> </response> </jdbc:outbound-endpoint> <default-exception-strategy> <logger message="DB Error"/> </default-exception-strategy> </flow>
    • Similar Issues:
      MULE-6066Default Exception Strategy ignored with CXF component
      MULE-5895As a user I want to be able to define a custom default exception strategy that is used when a a flow or service does not define one explicitly
      MULE-6471Default exception strategy is not being called
      MULE-5492default-exception-strategy clean session property
      MULE-6223Erroneous behaviour of <rollback-transaction> in <default-exception-strategy>
      MULE-5738When configuring <default-exception-strategy> inbound transaction is committed by default when no commit or rollback pattern is configured
      MULE-14Default exception strategy on the Model
      MULE-5346Should allow for the setting of a default exception strategy on a per application basis
      MULE-5269Clean up exception strategy schema elements after exception strategy work in core
      MULE-5066<async> doesn't work inside synchronous flows

      Description

      Forum Posting: http://forums.mulesoft.org/thread.jspa?threadID=4799&tstart=0

      Exception handling within <flow> doesn't work properly.
      To replicate the issue create the table as given below and fire same record details twice so that the database returns duplicate key exception.

      Table Schema - MySQL 5.5
      -------------
      CREATE TABLE master_transaction (
      `id` INT(11) NOT NULL AUTO_INCREMENT ,
      `sender_id` VARCHAR(25) NOT NULL ,
      `partner_trans_id` VARCHAR(45) NULL DEFAULT NULL ,
      `request_type` VARCHAR(10) NULL DEFAULT NULL ,
      PRIMARY KEY (`id`) )

      CREATE UNIQUE INDEX `sender_id` ON `master_transaction` (`sender_id` ASC) ;

      In Config1:
      I was expecting "DB Error" to be logged. But not so, instead I see the logger inside the calling flow PassThroughServiceFlow being invoked. Please see the message below.

      DEBUG 2011-02-24 17:06:08,350 http://connector.http.0.receiver.2 org.mule.api.processor.LoggerMessageProcessor: Error in PassThroughServiceFlow

      In Config2:
      I have embedded the <flow-ref name="DB"/> within a <wiretap> and I see that none of the default-exception-strategy> blocks get executed.

        Activity

        Hide
        Victor Romero added a comment -

        default-exception-strategy is not meant to be used in this way anymore. Exception strategy model changed in 3.3

        Show
        Victor Romero added a comment - default-exception-strategy is not meant to be used in this way anymore. Exception strategy model changed in 3.3

          People

          • Assignee:
            Pablo La Greca
            Reporter:
            sathwik bp
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development