You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/03/07 04:18:51 UTC
[2/2] git commit: Added a warning log when we get the exception from
xmlrpc server
Added a warning log when we get the exception from xmlrpc server
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/11559611
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/11559611
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/11559611
Branch: refs/heads/master
Commit: 11559611b43cc7e58c5bdfad42935b1c0dece8c8
Parents: 44cad62
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Mar 7 11:16:34 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Mar 7 11:17:53 2014 +0800
----------------------------------------------------------------------
.../camel/component/xmlrpc/XmlRpcProducer.java | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/11559611/components/camel-xmlrpc/src/main/java/org/apache/camel/component/xmlrpc/XmlRpcProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlrpc/src/main/java/org/apache/camel/component/xmlrpc/XmlRpcProducer.java b/components/camel-xmlrpc/src/main/java/org/apache/camel/component/xmlrpc/XmlRpcProducer.java
index 04be300..1dd2c8b 100644
--- a/components/camel-xmlrpc/src/main/java/org/apache/camel/component/xmlrpc/XmlRpcProducer.java
+++ b/components/camel-xmlrpc/src/main/java/org/apache/camel/component/xmlrpc/XmlRpcProducer.java
@@ -44,12 +44,17 @@ public class XmlRpcProducer extends DefaultProducer implements AsyncProcessor {
LOG.trace("Process exchange: {} in the sync way.", exchange);
Message in = exchange.getIn();
String operationName = in.getHeader(XmlRpcConstants.METHOD_NAME, String.class);
- //TODO need to use the binding to handle the requests
- Object result = client.execute(operationName, in.getBody(List.class));
- //TODO what if the request is one way operation
- // copy the in message header to the out message
- exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
- exchange.getOut().setBody(result);
+ try {
+ //TODO need to use the binding to handle the requests
+ Object result = client.execute(operationName, in.getBody(List.class));
+ //TODO what if the request is one way operation
+ // copy the in message header to the out message
+ exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
+ exchange.getOut().setBody(result);
+ } catch (Exception ex) {
+ LOG.warn("Got an exception {0} when invoke the XMLRPC service", ex);
+ exchange.setException(ex);
+ }
}
public boolean process(Exchange exchange, AsyncCallback callback) {