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/09/26 09:10:31 UTC

[1/9] git commit: CAMEL-7863: Improve logging message and reduce verbosity from INFO to debug

Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x d21dbde45 -> c288a7d19
  refs/heads/camel-2.13.x a7b7206db -> 3a5497afc
  refs/heads/camel-2.14.x 58b60b264 -> efc285945


CAMEL-7863: Improve logging message and reduce verbosity from INFO to debug


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a21b68d4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a21b68d4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a21b68d4

Branch: refs/heads/camel-2.14.x
Commit: a21b68d4f76545a742f2886e40854e2b14b2307a
Parents: 58b60b2
Author: david <da...@davidkarlsen.com>
Authored: Thu Sep 25 19:57:06 2014 +0200
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:06:13 2014 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/cxf/CxfProducer.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a21b68d4/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
index 8246c4f..28e9913 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
@@ -332,11 +332,11 @@ public class CxfProducer extends DefaultProducer implements AsyncProcessor {
         BindingOperationInfo answer = null;
         String lp = ex.getIn().getHeader(CxfConstants.OPERATION_NAME, String.class);
         if (lp == null) {
-            LOG.info("CxfProducer cannot find the {} from message header, try to use the defaultOperationName", CxfConstants.OPERATION_NAME);
+            LOG.debug("CxfProducer cannot find the {} from message header, trying with defaultOperationName", CxfConstants.OPERATION_NAME);
             lp = endpoint.getDefaultOperationName();
         }
         if (lp == null) {
-            LOG.info("CxfProducer cannot find the {} from message header and there is no DefaultOperationName setting, CxfProducer will pick up the first available operation.",
+            LOG.debug("CxfProducer cannot find the {} from message header and there is no DefaultOperationName setting, CxfProducer will pick up the first available operation.",
                      CxfConstants.OPERATION_NAME);
             Collection<BindingOperationInfo> bois = 
                 client.getEndpoint().getEndpointInfo().getBinding().getOperations();


[6/9] git commit: CAMEL-7856 Added igoreDeleteMethodMessageBody option to CxfRsEndpoint

Posted by ni...@apache.org.
CAMEL-7856 Added igoreDeleteMethodMessageBody option to CxfRsEndpoint

Conflicts:
	components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3a5497af
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3a5497af
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3a5497af

Branch: refs/heads/camel-2.13.x
Commit: 3a5497afcb533f083cb726f57c0153b44e7f52ed
Parents: 55c5c4b
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Sep 26 15:02:27 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:08:56 2014 +0800

----------------------------------------------------------------------
 .../component/cxf/jaxrs/CxfRsEndpoint.java      | 85 +++++++++++---------
 .../component/cxf/jaxrs/CxfRsProducer.java      | 17 ++--
 .../component/cxf/jaxrs/CxfRsSpringRouter.xml   |  7 +-
 3 files changed, 61 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3a5497af/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index d3e29c2..b4b63a1 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -51,7 +51,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware, Service {
-    
+
     public enum BindingStyle {
         /**
          * <i>Only available for consumers.</i>
@@ -60,7 +60,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
          * It also also adds more flexibility and simplicity to the response mapping.
          */
         SimpleConsumer,
-        
+
         /**
          * This is the traditional binding style, which simply dumps the {@link org.apache.cxf.message.MessageContentsList} coming in from the CXF stack
          * onto the IN message body. The user is then responsible for processing it according to the contract defined by the JAX-RS method signature.
@@ -77,9 +77,9 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     private static final Logger LOG = LoggerFactory.getLogger(CxfRsEndpoint.class);
 
     protected Bus bus;
-    
+
     protected List<Object> entityProviders = new LinkedList<Object>();
-    
+
     protected List<String> schemaLocations;
 
     private Map<String, String> parameters;
@@ -87,6 +87,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     private HeaderFilterStrategy headerFilterStrategy;
     private CxfRsBinding binding;
     private boolean httpClientAPI = true;
+    private boolean ignoreDeleteMethodMessageBody;
     private String address;
     private boolean throwExceptionOnFailure = true;
     private int maxClientCacheSize = 10;
@@ -94,13 +95,13 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     private int loggingSizeLimit;
     private boolean skipFaultLogging;
     private BindingStyle bindingStyle = BindingStyle.Default;
-   
+
     private boolean isSetDefaultBus;
-    
+
     private List<Feature> features = new ModCountCopyOnWriteArrayList<Feature>();
     private InterceptorHolder interceptorHolder = new InterceptorHolder();
     private Map<String, Object> properties;
-   
+
 
     @Deprecated
     public CxfRsEndpoint(String endpointUri, CamelContext camelContext) {
@@ -171,7 +172,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public CxfRsBinding getBinding() {
         return binding;
     }
-    
+
     public boolean isSkipFaultLogging() {
         return skipFaultLogging;
     }
@@ -179,7 +180,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public void setSkipFaultLogging(boolean skipFaultLogging) {
         this.skipFaultLogging = skipFaultLogging;
     }
-    
+
     protected void checkBeanType(Object object, Class<?> clazz) {
         if (!clazz.isAssignableFrom(object.getClass())) {
             throw new IllegalArgumentException("The configure bean is not the instance of " + clazz.getName());
@@ -215,7 +216,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         setupCommonFactoryProperties(cfb);
         cfb.setThreadSafe(true);
     }
-    
+
     protected void setupCommonFactoryProperties(AbstractJAXRSFactoryBean factory) {
         // let customer to override the default setting of provider
         if (!getProviders().isEmpty()) {
@@ -225,11 +226,11 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         if (!getFeatures().isEmpty()) {
             factory.getFeatures().addAll(getFeatures());
         }
-        
+
         // we need to avoid flushing the setting from spring or blueprint
         if (!interceptorHolder.getInInterceptors().isEmpty()) {
             factory.setInInterceptors(interceptorHolder.getInInterceptors());
-        } 
+        }
         if (!interceptorHolder.getOutInterceptors().isEmpty()) {
             factory.setOutInterceptors(interceptorHolder.getOutInterceptors());
         }
@@ -237,9 +238,9 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
             factory.setOutFaultInterceptors(interceptorHolder.getOutFaultInterceptors());
         }
         if (!interceptorHolder.getInFaultInterceptors().isEmpty()) {
-            factory.setInFaultInterceptors(interceptorHolder.getInFaultInterceptors()); 
+            factory.setInFaultInterceptors(interceptorHolder.getInFaultInterceptors());
         }
-        
+
         if (getProperties() != null) {
             if (factory.getProperties() != null) {
                 // add to existing properties
@@ -249,7 +250,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
             }
             LOG.debug("JAXRS FactoryBean: {} added properties: {}", factory, getProperties());
         }
-        
+
         if (isLoggingFeatureEnabled()) {
             if (getLoggingSizeLimit() > 0) {
                 factory.getFeatures().add(new LoggingFeature(getLoggingSizeLimit()));
@@ -264,15 +265,15 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
             factory.getProperties().put(FaultListener.class.getName(), new NullFaultListener());
         }
     }
-    
+
     protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
         return new JAXRSServerFactoryBean();
     }
-    
+
     protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
         return new JAXRSClientFactoryBean();
     }
-    
+
     protected String resolvePropertyPlaceholders(String str) {
         try {
             if (getCamelContext() != null) {
@@ -291,12 +292,12 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         setupJAXRSServerFactoryBean(answer);
         return answer;
     }
-    
+
 
     public JAXRSClientFactoryBean createJAXRSClientFactoryBean() {
         return createJAXRSClientFactoryBean(getAddress());
     }
-    
+
     public JAXRSClientFactoryBean createJAXRSClientFactoryBean(String address) {
         JAXRSClientFactoryBean answer = newJAXRSClientFactoryBean();
         setupJAXRSClientFactoryBean(answer, address);
@@ -320,7 +321,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public void setResourceClasses(Class<?>... classes) {
         setResourceClasses(Arrays.asList(classes));
     }
-    
+
     public void setAddress(String address) {
         this.address = address;
     }
@@ -366,7 +367,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public int getMaxClientCacheSize() {
         return maxClientCacheSize;
     }
-    
+
     public void setBus(Bus bus) {
         this.bus = bus;
         if (isSetDefaultBus) {
@@ -378,7 +379,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public Bus getBus() {
         return bus;
     }
-    
+
     public void setSetDefaultBus(boolean isSetDefaultBus) {
         this.isSetDefaultBus = isSetDefaultBus;
     }
@@ -386,31 +387,39 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public boolean isSetDefaultBus() {
         return isSetDefaultBus;
     }
-    
+
+    public boolean isIgnoreDeleteMethodMessageBody() {
+        return ignoreDeleteMethodMessageBody;
+    }
+
+    public void setIgnoreDELETEMethodMessageBody(boolean ignoreDELETEMethodMessageBody) {
+        this.ignoreDeleteMethodMessageBody = ignoreDELETEMethodMessageBody;
+    }
+
     public BindingStyle getBindingStyle() {
         return bindingStyle;
     }
-    
+
     public List<?> getProviders() {
         return entityProviders;
     }
-    
+
     public void setProviders(List<?> providers) {
         this.entityProviders.addAll(providers);
     }
-    
+
     public void setProvider(Object provider) {
         entityProviders.add(provider);
     }
-    
+
     public void setSchemaLocation(String schema) {
-        setSchemaLocations(Collections.singletonList(schema));    
+        setSchemaLocations(Collections.singletonList(schema));
     }
-    
+
     public void setSchemaLocations(List<String> schemas) {
-        this.schemaLocations = schemas;    
+        this.schemaLocations = schemas;
     }
-    
+
     public List<String> getSchemaLocations() {
         return schemaLocations;
     }
@@ -446,7 +455,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public void setOutFaultInterceptors(List<Interceptor<? extends Message>> interceptors) {
         interceptorHolder.setOutFaultInterceptors(interceptors);
     }
-    
+
     public List<Feature> getFeatures() {
         return features;
     }
@@ -458,7 +467,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public Map<String, Object> getProperties() {
         return properties;
     }
-    
+
     public void setProperties(Map<String, Object> properties) {
         if (this.properties == null) {
             this.properties = properties;
@@ -466,14 +475,14 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
             this.properties.putAll(properties);
         }
     }
-    
+
     /**
      * See documentation of {@link BindingStyle}.
      */
     public void setBindingStyle(BindingStyle bindingStyle) {
         this.bindingStyle = bindingStyle;
     }
-    
+
     @Override
     protected void doStart() throws Exception {
         if (headerFilterStrategy == null) {
@@ -488,7 +497,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         // if the user has set a binding, do nothing, just make sure that BindingStyle = Custom for coherency purposes
         if (binding != null) {
             bindingStyle = BindingStyle.Custom;
-        } 
+        }
 
         // set the right binding based on the binding style
         if (bindingStyle == BindingStyle.SimpleConsumer) {
@@ -498,7 +507,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         } else {
             binding = new DefaultCxfRsBinding();
         }
-        
+
         if (binding instanceof HeaderFilterStrategyAware) {
             ((HeaderFilterStrategyAware) binding).setHeaderFilterStrategy(getHeaderFilterStrategy());
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/3a5497af/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
index c580445..7129829 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
@@ -57,12 +57,15 @@ public class CxfRsProducer extends DefaultProducer {
 
     private boolean throwException;
     
+    private CxfRsEndpoint cxfRsEndpoint;
+    
     // using a cache of factory beans instead of setting the address of a single cfb
     // to avoid concurrent issues
     private ClientFactoryBeanCache clientFactoryBeanCache;
     
     public CxfRsProducer(CxfRsEndpoint endpoint) {
         super(endpoint);
+        cxfRsEndpoint = endpoint;
         this.throwException = endpoint.isThrowExceptionOnFailure();
         clientFactoryBeanCache = new ClientFactoryBeanCache(endpoint.getMaxClientCacheSize());
     }
@@ -158,11 +161,15 @@ public class CxfRsProducer extends DefaultProducer {
 
         // set the body
         Object body = null;
-        if (!"GET".equals(httpMethod) && !"DELETE".equals(httpMethod)) {
-            // need to check the request object if the http Method is not GET or DELETE           
-            body = binding.bindCamelMessageBodyToRequestBody(inMessage, exchange);
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Request body = " + body);
+        if (!"GET".equals(httpMethod)) {
+            // need to check the request object if the http Method is not GET      
+            if ("DELETE".equals(httpMethod) && cxfRsEndpoint.isIgnoreDeleteMethodMessageBody()) {
+                // just ignore the message body if the ignoreDeleteMethodMessageBody is true
+            } else {
+                body = binding.bindCamelMessageBodyToRequestBody(inMessage, exchange);
+                if (LOG.isTraceEnabled()) {
+                    LOG.trace("Request body = " + body);
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/3a5497af/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
index 9f51dd6..172aac1 100644
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
+++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
@@ -63,12 +63,9 @@
   <!-- The camel route context -->
   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
     <route>
-       <from uri="cxfrs://bean://rsServer"/>
+       <!-- Just need to ignoreDeleteMethodMessageBody -->
+       <from uri="cxfrs://bean://rsServer?ignoreDeleteMethodMessageBody=true"/>
        <to uri="log:body?level=INFO"/>
-       <!-- We can remove this configure as the CXFRS producer is using the HttpAPI by default -->
-       <setHeader headerName="CamelCxfRsUsingHttpAPI">
-         <constant>True</constant>        
-       </setHeader>
        <to uri="cxfrs://bean://rsClient"/>
     </route>
   </camelContext>


[3/9] git commit: CAMEL-7856 Added igoreDeleteMethodMessageBody option to CxfRsEndpoint

Posted by ni...@apache.org.
CAMEL-7856 Added igoreDeleteMethodMessageBody option to CxfRsEndpoint


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/efc28594
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/efc28594
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/efc28594

Branch: refs/heads/camel-2.14.x
Commit: efc285945c2ac1732bb1b1dde5ee727b8772ce3e
Parents: 613856a
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Sep 26 15:02:27 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:06:30 2014 +0800

----------------------------------------------------------------------
 .../camel/component/cxf/jaxrs/CxfRsEndpoint.java   | 10 ++++++++++
 .../camel/component/cxf/jaxrs/CxfRsProducer.java   | 17 ++++++++++++-----
 .../component/cxf/jaxrs/CxfRsSpringRouter.xml      |  7 ++-----
 3 files changed, 24 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/efc28594/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index 12da6c3..1a04617 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -91,6 +91,8 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     @UriParam
     private boolean httpClientAPI = true;
     @UriParam
+    private boolean ignoreDeleteMethodMessageBody;
+    @UriParam
     private String address;
     @UriParam
     private boolean throwExceptionOnFailure = true;
@@ -400,6 +402,14 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         return isSetDefaultBus;
     }
     
+    public boolean isIgnoreDeleteMethodMessageBody() {
+        return ignoreDeleteMethodMessageBody;
+    }
+
+    public void setIgnoreDELETEMethodMessageBody(boolean ignoreDELETEMethodMessageBody) {
+        this.ignoreDeleteMethodMessageBody = ignoreDELETEMethodMessageBody;
+    }
+
     public BindingStyle getBindingStyle() {
         return bindingStyle;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/efc28594/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
index c0798fa..5f5db26 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
@@ -57,12 +57,15 @@ public class CxfRsProducer extends DefaultProducer {
 
     private boolean throwException;
     
+    private CxfRsEndpoint cxfRsEndpoint;
+    
     // using a cache of factory beans instead of setting the address of a single cfb
     // to avoid concurrent issues
     private ClientFactoryBeanCache clientFactoryBeanCache;
     
     public CxfRsProducer(CxfRsEndpoint endpoint) {
         super(endpoint);
+        cxfRsEndpoint = endpoint;
         this.throwException = endpoint.isThrowExceptionOnFailure();
         clientFactoryBeanCache = new ClientFactoryBeanCache(endpoint.getMaxClientCacheSize());
     }
@@ -158,11 +161,15 @@ public class CxfRsProducer extends DefaultProducer {
 
         // set the body
         Object body = null;
-        if (!"GET".equals(httpMethod) && !"DELETE".equals(httpMethod)) {
-            // need to check the request object if the http Method is not GET or DELETE           
-            body = binding.bindCamelMessageBodyToRequestBody(inMessage, exchange);
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Request body = " + body);
+        if (!"GET".equals(httpMethod)) {
+            // need to check the request object if the http Method is not GET      
+            if ("DELETE".equals(httpMethod) && cxfRsEndpoint.isIgnoreDeleteMethodMessageBody()) {
+                // just ignore the message body if the ignoreDeleteMethodMessageBody is true
+            } else {
+                body = binding.bindCamelMessageBodyToRequestBody(inMessage, exchange);
+                if (LOG.isTraceEnabled()) {
+                    LOG.trace("Request body = " + body);
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/efc28594/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
index 9f51dd6..172aac1 100644
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
+++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
@@ -63,12 +63,9 @@
   <!-- The camel route context -->
   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
     <route>
-       <from uri="cxfrs://bean://rsServer"/>
+       <!-- Just need to ignoreDeleteMethodMessageBody -->
+       <from uri="cxfrs://bean://rsServer?ignoreDeleteMethodMessageBody=true"/>
        <to uri="log:body?level=INFO"/>
-       <!-- We can remove this configure as the CXFRS producer is using the HttpAPI by default -->
-       <setHeader headerName="CamelCxfRsUsingHttpAPI">
-         <constant>True</constant>        
-       </setHeader>
        <to uri="cxfrs://bean://rsClient"/>
     </route>
   </camelContext>


[4/9] git commit: CAMEL-7863: Improve logging message and reduce verbosity from INFO to debug

Posted by ni...@apache.org.
CAMEL-7863: Improve logging message and reduce verbosity from INFO to debug


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/94c748ca
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/94c748ca
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/94c748ca

Branch: refs/heads/camel-2.13.x
Commit: 94c748ca5e850dcaec8605e2ae77fc1091069771
Parents: a7b7206
Author: david <da...@davidkarlsen.com>
Authored: Thu Sep 25 19:57:06 2014 +0200
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:06:58 2014 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/cxf/CxfProducer.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/94c748ca/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
index 8246c4f..28e9913 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
@@ -332,11 +332,11 @@ public class CxfProducer extends DefaultProducer implements AsyncProcessor {
         BindingOperationInfo answer = null;
         String lp = ex.getIn().getHeader(CxfConstants.OPERATION_NAME, String.class);
         if (lp == null) {
-            LOG.info("CxfProducer cannot find the {} from message header, try to use the defaultOperationName", CxfConstants.OPERATION_NAME);
+            LOG.debug("CxfProducer cannot find the {} from message header, trying with defaultOperationName", CxfConstants.OPERATION_NAME);
             lp = endpoint.getDefaultOperationName();
         }
         if (lp == null) {
-            LOG.info("CxfProducer cannot find the {} from message header and there is no DefaultOperationName setting, CxfProducer will pick up the first available operation.",
+            LOG.debug("CxfProducer cannot find the {} from message header and there is no DefaultOperationName setting, CxfProducer will pick up the first available operation.",
                      CxfConstants.OPERATION_NAME);
             Collection<BindingOperationInfo> bois = 
                 client.getEndpoint().getEndpointInfo().getBinding().getOperations();


[7/9] git commit: CAMEL-7863: Improve logging message and reduce verbosity from INFO to debug

Posted by ni...@apache.org.
CAMEL-7863: Improve logging message and reduce verbosity from INFO to debug


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ff403643
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ff403643
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ff403643

Branch: refs/heads/camel-2.12.x
Commit: ff4036434788625fc6f76cba629879595a3bbddb
Parents: d21dbde
Author: david <da...@davidkarlsen.com>
Authored: Thu Sep 25 19:57:06 2014 +0200
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:09:23 2014 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/cxf/CxfProducer.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ff403643/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
index 8246c4f..28e9913 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
@@ -332,11 +332,11 @@ public class CxfProducer extends DefaultProducer implements AsyncProcessor {
         BindingOperationInfo answer = null;
         String lp = ex.getIn().getHeader(CxfConstants.OPERATION_NAME, String.class);
         if (lp == null) {
-            LOG.info("CxfProducer cannot find the {} from message header, try to use the defaultOperationName", CxfConstants.OPERATION_NAME);
+            LOG.debug("CxfProducer cannot find the {} from message header, trying with defaultOperationName", CxfConstants.OPERATION_NAME);
             lp = endpoint.getDefaultOperationName();
         }
         if (lp == null) {
-            LOG.info("CxfProducer cannot find the {} from message header and there is no DefaultOperationName setting, CxfProducer will pick up the first available operation.",
+            LOG.debug("CxfProducer cannot find the {} from message header and there is no DefaultOperationName setting, CxfProducer will pick up the first available operation.",
                      CxfConstants.OPERATION_NAME);
             Collection<BindingOperationInfo> bois = 
                 client.getEndpoint().getEndpointInfo().getBinding().getOperations();


[2/9] git commit: CAMEL-7863 Updated the java doc for the operation name lookup.

Posted by ni...@apache.org.
CAMEL-7863 Updated the java doc for the operation name lookup.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/613856a9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/613856a9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/613856a9

Branch: refs/heads/camel-2.14.x
Commit: 613856a97f52c69a9fea6d1305cf898c5c5ce23b
Parents: a21b68d
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Sep 26 11:29:36 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:06:21 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/cxf/CxfProducer.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/613856a9/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
index 28e9913..ea0e6d7 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
@@ -324,8 +324,14 @@ public class CxfProducer extends DefaultProducer implements AsyncProcessor {
     }
 
     /**
-     * Get operation name from header and use it to lookup and return a 
-     * {@link BindingOperationInfo}.
+     * <p>Get operation name from header and use it to lookup and return a 
+     * {@link BindingOperationInfo}.</p>
+     * <p>CxfProducer lookups the operation name lookup with below order, and it uses the first found one which is not null:</p>
+     *  <ul>
+     *    <li> Using the in message header "operationName". </li>
+     *    <li> Using the defaultOperationName option value from the CxfEndpoint. </li>
+     *    <li> Using the first operation which is find from the CxfEndpoint Operations list. </li>
+     *  <ul>
      */
     private BindingOperationInfo getBindingOperationInfo(Exchange ex) {
         CxfEndpoint endpoint = (CxfEndpoint)this.getEndpoint();


[5/9] git commit: CAMEL-7863 Updated the java doc for the operation name lookup.

Posted by ni...@apache.org.
CAMEL-7863 Updated the java doc for the operation name lookup.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/55c5c4b4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/55c5c4b4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/55c5c4b4

Branch: refs/heads/camel-2.13.x
Commit: 55c5c4b4d26b97a4f61d660a0951e617dc9fdb68
Parents: 94c748c
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Sep 26 11:29:36 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:07:02 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/cxf/CxfProducer.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/55c5c4b4/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
index 28e9913..ea0e6d7 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
@@ -324,8 +324,14 @@ public class CxfProducer extends DefaultProducer implements AsyncProcessor {
     }
 
     /**
-     * Get operation name from header and use it to lookup and return a 
-     * {@link BindingOperationInfo}.
+     * <p>Get operation name from header and use it to lookup and return a 
+     * {@link BindingOperationInfo}.</p>
+     * <p>CxfProducer lookups the operation name lookup with below order, and it uses the first found one which is not null:</p>
+     *  <ul>
+     *    <li> Using the in message header "operationName". </li>
+     *    <li> Using the defaultOperationName option value from the CxfEndpoint. </li>
+     *    <li> Using the first operation which is find from the CxfEndpoint Operations list. </li>
+     *  <ul>
      */
     private BindingOperationInfo getBindingOperationInfo(Exchange ex) {
         CxfEndpoint endpoint = (CxfEndpoint)this.getEndpoint();


[9/9] git commit: CAMEL-7856 Added igoreDeleteMethodMessageBody option to CxfRsEndpoint

Posted by ni...@apache.org.
CAMEL-7856 Added igoreDeleteMethodMessageBody option to CxfRsEndpoint

Conflicts:
	components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c288a7d1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c288a7d1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c288a7d1

Branch: refs/heads/camel-2.12.x
Commit: c288a7d192d156bf8801eb7707bb14ae9b9eeee0
Parents: b66cb6d
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Sep 26 15:02:27 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:09:59 2014 +0800

----------------------------------------------------------------------
 .../component/cxf/jaxrs/CxfRsEndpoint.java      | 85 +++++++++++---------
 .../component/cxf/jaxrs/CxfRsProducer.java      | 17 ++--
 .../component/cxf/jaxrs/CxfRsSpringRouter.xml   |  7 +-
 3 files changed, 61 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c288a7d1/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index a2f4d32..cd84fb2 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -53,7 +53,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware, Service {
-    
+
     public enum BindingStyle {
         /**
          * <i>Only available for consumers.</i>
@@ -62,7 +62,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
          * It also also adds more flexibility and simplicity to the response mapping.
          */
         SimpleConsumer,
-        
+
         /**
          * This is the traditional binding style, which simply dumps the {@link org.apache.cxf.message.MessageContentsList} coming in from the CXF stack
          * onto the IN message body. The user is then responsible for processing it according to the contract defined by the JAX-RS method signature.
@@ -79,9 +79,9 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     private static final Logger LOG = LoggerFactory.getLogger(CxfRsEndpoint.class);
 
     protected Bus bus;
-    
+
     protected List<Object> entityProviders = new LinkedList<Object>();
-    
+
     protected List<String> schemaLocations;
 
     private Map<String, String> parameters;
@@ -89,6 +89,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     private HeaderFilterStrategy headerFilterStrategy;
     private CxfRsBinding binding;
     private boolean httpClientAPI = true;
+    private boolean ignoreDeleteMethodMessageBody;
     private String address;
     private boolean throwExceptionOnFailure = true;
     private int maxClientCacheSize = 10;
@@ -96,13 +97,13 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     private int loggingSizeLimit;
     private boolean skipFaultLogging;
     private BindingStyle bindingStyle = BindingStyle.Default;
-   
+
     private boolean isSetDefaultBus;
-    
+
     private List<Feature> features = new ModCountCopyOnWriteArrayList<Feature>();
     private InterceptorHolder interceptorHolder = new InterceptorHolder();
     private Map<String, Object> properties;
-   
+
 
     @Deprecated
     public CxfRsEndpoint(String endpointUri, CamelContext camelContext) {
@@ -173,7 +174,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public CxfRsBinding getBinding() {
         return binding;
     }
-    
+
     public boolean isSkipFaultLogging() {
         return skipFaultLogging;
     }
@@ -181,7 +182,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public void setSkipFaultLogging(boolean skipFaultLogging) {
         this.skipFaultLogging = skipFaultLogging;
     }
-    
+
     protected void checkBeanType(Object object, Class<?> clazz) {
         if (!clazz.isAssignableFrom(object.getClass())) {
             throw new IllegalArgumentException("The configure bean is not the instance of " + clazz.getName());
@@ -217,7 +218,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         setupCommonFactoryProperties(cfb);
         cfb.setThreadSafe(true);
     }
-    
+
     protected void setupCommonFactoryProperties(AbstractJAXRSFactoryBean factory) {
         // let customer to override the default setting of provider
         if (!getProviders().isEmpty()) {
@@ -227,11 +228,11 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         if (!getFeatures().isEmpty()) {
             factory.getFeatures().addAll(getFeatures());
         }
-        
+
         // we need to avoid flushing the setting from spring or blueprint
         if (!interceptorHolder.getInInterceptors().isEmpty()) {
             factory.setInInterceptors(interceptorHolder.getInInterceptors());
-        } 
+        }
         if (!interceptorHolder.getOutInterceptors().isEmpty()) {
             factory.setOutInterceptors(interceptorHolder.getOutInterceptors());
         }
@@ -239,9 +240,9 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
             factory.setOutFaultInterceptors(interceptorHolder.getOutFaultInterceptors());
         }
         if (!interceptorHolder.getInFaultInterceptors().isEmpty()) {
-            factory.setInFaultInterceptors(interceptorHolder.getInFaultInterceptors()); 
+            factory.setInFaultInterceptors(interceptorHolder.getInFaultInterceptors());
         }
-        
+
         if (getProperties() != null) {
             if (factory.getProperties() != null) {
                 // add to existing properties
@@ -251,7 +252,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
             }
             LOG.debug("JAXRS FactoryBean: {} added properties: {}", factory, getProperties());
         }
-        
+
         if (isLoggingFeatureEnabled()) {
             if (getLoggingSizeLimit() > 0) {
                 factory.getFeatures().add(new LoggingFeature(getLoggingSizeLimit()));
@@ -266,15 +267,15 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
             factory.getProperties().put(FaultListener.class.getName(), new NullFaultListener());
         }
     }
-    
+
     protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
         return new JAXRSServerFactoryBean();
     }
-    
+
     protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
         return new JAXRSClientFactoryBean();
     }
-    
+
     protected String resolvePropertyPlaceholders(String str) {
         try {
             if (getCamelContext() != null) {
@@ -293,12 +294,12 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         setupJAXRSServerFactoryBean(answer);
         return answer;
     }
-    
+
 
     public JAXRSClientFactoryBean createJAXRSClientFactoryBean() {
         return createJAXRSClientFactoryBean(getAddress());
     }
-    
+
     public JAXRSClientFactoryBean createJAXRSClientFactoryBean(String address) {
         JAXRSClientFactoryBean answer = newJAXRSClientFactoryBean();
         setupJAXRSClientFactoryBean(answer, address);
@@ -322,7 +323,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public void setResourceClasses(Class<?>... classes) {
         setResourceClasses(Arrays.asList(classes));
     }
-    
+
     public void setAddress(String address) {
         this.address = address;
     }
@@ -368,7 +369,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public int getMaxClientCacheSize() {
         return maxClientCacheSize;
     }
-    
+
     public void setBus(Bus bus) {
         this.bus = bus;
         if (isSetDefaultBus) {
@@ -380,7 +381,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public Bus getBus() {
         return bus;
     }
-    
+
     public void setSetDefaultBus(boolean isSetDefaultBus) {
         this.isSetDefaultBus = isSetDefaultBus;
     }
@@ -388,31 +389,39 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public boolean isSetDefaultBus() {
         return isSetDefaultBus;
     }
-    
+
+    public boolean isIgnoreDeleteMethodMessageBody() {
+        return ignoreDeleteMethodMessageBody;
+    }
+
+    public void setIgnoreDELETEMethodMessageBody(boolean ignoreDELETEMethodMessageBody) {
+        this.ignoreDeleteMethodMessageBody = ignoreDELETEMethodMessageBody;
+    }
+
     public BindingStyle getBindingStyle() {
         return bindingStyle;
     }
-    
+
     public List<?> getProviders() {
         return entityProviders;
     }
-    
+
     public void setProviders(List<?> providers) {
         this.entityProviders.addAll(providers);
     }
-    
+
     public void setProvider(Object provider) {
         entityProviders.add(provider);
     }
-    
+
     public void setSchemaLocation(String schema) {
-        setSchemaLocations(Collections.singletonList(schema));    
+        setSchemaLocations(Collections.singletonList(schema));
     }
-    
+
     public void setSchemaLocations(List<String> schemas) {
-        this.schemaLocations = schemas;    
+        this.schemaLocations = schemas;
     }
-    
+
     public List<String> getSchemaLocations() {
         return schemaLocations;
     }
@@ -448,7 +457,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public void setOutFaultInterceptors(List<Interceptor<? extends Message>> interceptors) {
         interceptorHolder.setOutFaultInterceptors(interceptors);
     }
-    
+
     public List<Feature> getFeatures() {
         return features;
     }
@@ -460,7 +469,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public Map<String, Object> getProperties() {
         return properties;
     }
-    
+
     public void setProperties(Map<String, Object> properties) {
         if (this.properties == null) {
             this.properties = properties;
@@ -468,14 +477,14 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
             this.properties.putAll(properties);
         }
     }
-    
+
     /**
      * See documentation of {@link BindingStyle}.
      */
     public void setBindingStyle(BindingStyle bindingStyle) {
         this.bindingStyle = bindingStyle;
     }
-    
+
     @Override
     protected void doStart() throws Exception {
         if (headerFilterStrategy == null) {
@@ -490,7 +499,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         // if the user has set a binding, do nothing, just make sure that BindingStyle = Custom for coherency purposes
         if (binding != null) {
             bindingStyle = BindingStyle.Custom;
-        } 
+        }
 
         // set the right binding based on the binding style
         if (bindingStyle == BindingStyle.SimpleConsumer) {
@@ -500,7 +509,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         } else {
             binding = new DefaultCxfRsBinding();
         }
-        
+
         if (binding instanceof HeaderFilterStrategyAware) {
             ((HeaderFilterStrategyAware) binding).setHeaderFilterStrategy(getHeaderFilterStrategy());
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/c288a7d1/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
index c580445..7129829 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
@@ -57,12 +57,15 @@ public class CxfRsProducer extends DefaultProducer {
 
     private boolean throwException;
     
+    private CxfRsEndpoint cxfRsEndpoint;
+    
     // using a cache of factory beans instead of setting the address of a single cfb
     // to avoid concurrent issues
     private ClientFactoryBeanCache clientFactoryBeanCache;
     
     public CxfRsProducer(CxfRsEndpoint endpoint) {
         super(endpoint);
+        cxfRsEndpoint = endpoint;
         this.throwException = endpoint.isThrowExceptionOnFailure();
         clientFactoryBeanCache = new ClientFactoryBeanCache(endpoint.getMaxClientCacheSize());
     }
@@ -158,11 +161,15 @@ public class CxfRsProducer extends DefaultProducer {
 
         // set the body
         Object body = null;
-        if (!"GET".equals(httpMethod) && !"DELETE".equals(httpMethod)) {
-            // need to check the request object if the http Method is not GET or DELETE           
-            body = binding.bindCamelMessageBodyToRequestBody(inMessage, exchange);
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Request body = " + body);
+        if (!"GET".equals(httpMethod)) {
+            // need to check the request object if the http Method is not GET      
+            if ("DELETE".equals(httpMethod) && cxfRsEndpoint.isIgnoreDeleteMethodMessageBody()) {
+                // just ignore the message body if the ignoreDeleteMethodMessageBody is true
+            } else {
+                body = binding.bindCamelMessageBodyToRequestBody(inMessage, exchange);
+                if (LOG.isTraceEnabled()) {
+                    LOG.trace("Request body = " + body);
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/c288a7d1/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
index 8576728..8661382 100644
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
+++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
@@ -55,12 +55,9 @@
   <!-- The camel route context -->
   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
     <route>
-       <from uri="cxfrs://bean://rsServer"/>
+       <!-- Just need to ignoreDeleteMethodMessageBody -->
+       <from uri="cxfrs://bean://rsServer?ignoreDeleteMethodMessageBody=true"/>
        <to uri="log:body?level=INFO"/>
-       <!-- We can remove this configure as the CXFRS producer is using the HttpAPI by default -->
-       <setHeader headerName="CamelCxfRsUsingHttpAPI">
-         <constant>True</constant>        
-       </setHeader>
        <to uri="cxfrs://bean://rsClient"/>
     </route>
   </camelContext>


[8/9] git commit: CAMEL-7863 Updated the java doc for the operation name lookup.

Posted by ni...@apache.org.
CAMEL-7863 Updated the java doc for the operation name lookup.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b66cb6d2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b66cb6d2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b66cb6d2

Branch: refs/heads/camel-2.12.x
Commit: b66cb6d2bd558f46dad77f700e9074d581ee534a
Parents: ff40364
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Sep 26 11:29:36 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 26 15:09:30 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/cxf/CxfProducer.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b66cb6d2/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
index 28e9913..ea0e6d7 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
@@ -324,8 +324,14 @@ public class CxfProducer extends DefaultProducer implements AsyncProcessor {
     }
 
     /**
-     * Get operation name from header and use it to lookup and return a 
-     * {@link BindingOperationInfo}.
+     * <p>Get operation name from header and use it to lookup and return a 
+     * {@link BindingOperationInfo}.</p>
+     * <p>CxfProducer lookups the operation name lookup with below order, and it uses the first found one which is not null:</p>
+     *  <ul>
+     *    <li> Using the in message header "operationName". </li>
+     *    <li> Using the defaultOperationName option value from the CxfEndpoint. </li>
+     *    <li> Using the first operation which is find from the CxfEndpoint Operations list. </li>
+     *  <ul>
      */
     private BindingOperationInfo getBindingOperationInfo(Exchange ex) {
         CxfEndpoint endpoint = (CxfEndpoint)this.getEndpoint();