Permalink
Browse files

SWITCHYARD-1950 for IN_ONLY, ClientProxyBean and camel OutboundHandle…

…r doesn't propagate a fault to the consumer
  • Loading branch information...
1 parent 1b3185c commit c2775b7b8eabcc929a0747637a75231ab4e79c45 @igarashitm igarashitm committed with rcernich Jan 30, 2014
@@ -63,6 +63,12 @@
String ROLLBACK_ON_FAULT = "org.switchyard.rollbackOnFault";
/**
+ * Domain property name used for a boolean flag which indicates if the exception should
+ * be propagate back to the service consumer.
+ */
+ String PROPAGATE_EXCEPTION_ON_IN_ONLY = "org.switchyard.propagateExceptionOnInOnly";
+
+ /**
* Retrieves the exchange context.
* @return the exchange context
*/
@@ -28,6 +28,7 @@
import org.switchyard.Exchange;
import org.switchyard.ExchangeHandler;
import org.switchyard.ExchangePattern;
+import org.switchyard.ExchangeState;
import org.switchyard.HandlerException;
import org.switchyard.Message;
import org.switchyard.Scope;
@@ -267,8 +268,9 @@ private void addAttachments(Message message) {
/**
* Send an IN_ONLY message to the target Service.
* @param messagePayload The message payload.
+ * @throws InvocationFaultException if the message exchange produces a fault
*/
- public void sendInOnly(Object messagePayload) {
+ public void sendInOnly(Object messagePayload) throws InvocationFaultException {
ExchangeHandlerProxy exchangeHandlerProxy = _exchangeHandlerProxy;
ResponseCatcher responseCatcher = null;
@@ -283,6 +285,10 @@ public void sendInOnly(Object messagePayload) {
setProperties(exchange, message);
addAttachments(message);
exchange.send(message);
+
+ if (exchange.getState().equals(ExchangeState.FAULT)) {
+ throw new InvocationFaultException(exchange.getMessage());
+ }
}
/**

0 comments on commit c2775b7

Please sign in to comment.