You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Gianfranco Boccalon (JIRA)" <ji...@apache.org> on 2008/09/30 18:07:52 UTC

[jira] Created: (SM-1604) TransformBeanSupport doesn't manage properly fault message when used in Sync mode

TransformBeanSupport doesn't manage properly fault message when used in Sync mode
---------------------------------------------------------------------------------

                 Key: SM-1604
                 URL: https://issues.apache.org/activemq/browse/SM-1604
             Project: ServiceMix
          Issue Type: Bug
          Components: servicemix-bean
            Reporter: Gianfranco Boccalon


The component sends always a Done message, even if it receives a fault, with the sendSync method.

I provide a patch to TransformBeanSupport, to send a fault (or error) message if the result of the sendSync is a fault message.
I don't provide a diff file because I have problems accessing the sources on SVN.

This is the code I changed in the onMessageExchange method.

            if (transform(exchange, in, out)) {
                if (isInAndOut(exchange)) {
                    exchange.setMessage(out, "out");
                    if (txSync) {
                        getDeliveryChannel().sendSync(exchange);
                    } else {
                        getDeliveryChannel().send(exchange);
                    }
                } else {
                    outExchange.setMessage(out, "in");
                    if (txSync) {
                        getDeliveryChannel().sendSync(outExchange);
                        
                        // HERE THE PATCH BEGINS
                        // Check result
                        if (outExchange.getStatus() == ExchangeStatus.DONE) {
                        	log.debug("["+exchange.getExchangeId()+"] | sendSync-> Received a DONE STATUS AS RESPONSE");
                            exchange.setStatus(ExchangeStatus.DONE);
                            getDeliveryChannel().send(exchange);
                        // Errors must be sent back to the consumer
                        } else if (outExchange.getStatus() == ExchangeStatus.ERROR) {
                        	log.debug("["+exchange.getExchangeId()+"] | sendSync-> Received an ERROR STATUS AS RESPONSE -> fail");
                            fail(exchange, outExchange.getError());
                        } else if (outExchange.getFault() != null) {
                        	log.info("["+exchange.getExchangeId()+"] | sendSync-> Received a FAULT AS RESPONSE -> fail");
                        	fail(exchange, outExchange.getError());
                        }
                        // HERE THE PATCH END

                    } else {
                        getDeliveryChannel().send(outExchange);

                        // HERE THE PATCH BEGINS
                        exchange.setStatus(ExchangeStatus.DONE);
                        getDeliveryChannel().send(exchange);
                        // HERE THE PATCH END

                    }
                }


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


[jira] Resolved: (SM-1604) TransformBeanSupport doesn't manage properly fault message when used in Sync mode

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved SM-1604.
---------------------------------

         Assignee: Guillaume Nodet
    Fix Version/s: servicemix-bean-2008.02
                   3.2.4
       Resolution: Fixed

Fix as part of SM-1668

> TransformBeanSupport doesn't manage properly fault message when used in Sync mode
> ---------------------------------------------------------------------------------
>
>                 Key: SM-1604
>                 URL: https://issues.apache.org/activemq/browse/SM-1604
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-bean
>            Reporter: Gianfranco Boccalon
>            Assignee: Guillaume Nodet
>             Fix For: servicemix-bean-2008.02, 3.2.4
>
>
> The component sends always a Done message, even if it receives a fault, with the sendSync method.
> I provide a patch to TransformBeanSupport, to send a fault (or error) message if the result of the sendSync is a fault message.
> I don't provide a diff file because I have problems accessing the sources on SVN.
> This is the code I changed in the onMessageExchange method.
>             if (transform(exchange, in, out)) {
>                 if (isInAndOut(exchange)) {
>                     exchange.setMessage(out, "out");
>                     if (txSync) {
>                         getDeliveryChannel().sendSync(exchange);
>                     } else {
>                         getDeliveryChannel().send(exchange);
>                     }
>                 } else {
>                     outExchange.setMessage(out, "in");
>                     if (txSync) {
>                         getDeliveryChannel().sendSync(outExchange);
>                         
>                         // HERE THE PATCH BEGINS
>                         // Check result
>                         if (outExchange.getStatus() == ExchangeStatus.DONE) {
>                         	log.debug("["+exchange.getExchangeId()+"] | sendSync-> Received a DONE STATUS AS RESPONSE");
>                             exchange.setStatus(ExchangeStatus.DONE);
>                             getDeliveryChannel().send(exchange);
>                         // Errors must be sent back to the consumer
>                         } else if (outExchange.getStatus() == ExchangeStatus.ERROR) {
>                         	log.debug("["+exchange.getExchangeId()+"] | sendSync-> Received an ERROR STATUS AS RESPONSE -> fail");
>                             fail(exchange, outExchange.getError());
>                         } else if (outExchange.getFault() != null) {
>                         	log.info("["+exchange.getExchangeId()+"] | sendSync-> Received a FAULT AS RESPONSE -> fail");
>                         	fail(exchange, outExchange.getError());
>                         }
>                         // HERE THE PATCH END
>                     } else {
>                         getDeliveryChannel().send(outExchange);
>                         // HERE THE PATCH BEGINS
>                         exchange.setStatus(ExchangeStatus.DONE);
>                         getDeliveryChannel().send(exchange);
>                         // HERE THE PATCH END
>                     }
>                 }

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