You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/12/23 14:49:18 UTC

[1/3] camel git commit: CAMEL-10633: Data formats marshal to xml/json now set content-type header by default.

Repository: camel
Updated Branches:
  refs/heads/master af22f502e -> 281528256


http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xmlbeans/src/main/docs/xmlBeans-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-xmlbeans/src/main/docs/xmlBeans-dataformat.adoc b/components/camel-xmlbeans/src/main/docs/xmlBeans-dataformat.adoc
index 612ac26..651ca09 100644
--- a/components/camel-xmlbeans/src/main/docs/xmlBeans-dataformat.adoc
+++ b/components/camel-xmlbeans/src/main/docs/xmlBeans-dataformat.adoc
@@ -19,7 +19,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The XML Beans dataformat supports 1 options which are listed below.
+The XML Beans dataformat supports 2 options which are listed below.
 
 
 
@@ -28,6 +28,7 @@ The XML Beans dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | prettyPrint | false | Boolean | To enable pretty printing output nicely formatted. Is by default false.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java b/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java
index 3b034b8..c858d95 100644
--- a/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java
+++ b/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java
@@ -34,8 +34,6 @@ import org.apache.camel.util.ObjectHelper;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.impl.piccolo.xml.XMLStreamReader;
 
-
-
 /**
  * A <a href="http://camel.apache.org/type-coverter.html">Type Converter</a>
  * of XMLBeans objects
@@ -53,7 +51,6 @@ public final class XmlBeansConverter {
                 return XmlObject.Factory.parse(value);
             }
         }, exchange); 
-        
     }
 
     @Converter

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansDataFormat.java b/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansDataFormat.java
index 8e0be84..b421dbc 100644
--- a/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansDataFormat.java
+++ b/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansDataFormat.java
@@ -34,6 +34,8 @@ import org.apache.xmlbeans.XmlObject;
  */
 public class XmlBeansDataFormat extends ServiceSupport implements DataFormat, DataFormatName {
 
+    private boolean contentTypeHeader = true;
+
     @Override
     public String getDataFormatName() {
         return "xmlBeans";
@@ -49,6 +51,13 @@ public class XmlBeansDataFormat extends ServiceSupport implements DataFormat, Da
             }
         }, exchange);
 
+        if (contentTypeHeader) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            }
+        }
     }
 
     public Object unmarshal(final Exchange exchange, final InputStream stream) throws Exception {
@@ -69,4 +78,17 @@ public class XmlBeansDataFormat extends ServiceSupport implements DataFormat, Da
     protected void doStop() throws Exception {
         // noop
     }
+
+
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then XmlBeans will set the Content-Type header to <tt>application/xml</tt> when marshalling.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xmljson/src/main/docs/xmljson-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-xmljson/src/main/docs/xmljson-dataformat.adoc b/components/camel-xmljson/src/main/docs/xmljson-dataformat.adoc
index 9a9528b..f94f545 100644
--- a/components/camel-xmljson/src/main/docs/xmljson-dataformat.adoc
+++ b/components/camel-xmljson/src/main/docs/xmljson-dataformat.adoc
@@ -24,7 +24,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The XML JSon dataformat supports 12 options which are listed below.
+The XML JSon dataformat supports 13 options which are listed below.
 
 
 
@@ -44,6 +44,7 @@ The XML JSon dataformat supports 12 options which are listed below.
 | removeNamespacePrefixes | false | Boolean | Removes the namespace prefixes from XML qualified elements so that the resulting JSON string does not contain them. Used for marshalling (XML to JSon conversion).
 | expandableProperties |  | List | With expandable properties JSON array elements are converted to XML as a sequence of repetitive XML elements with the local name equal to the JSON key for example: number: 123 normally converted to: 123 (where e can be modified by setting elementName) would instead translate to 123 if number is set as an expandable property Used for unmarshalling (JSON to XML conversion).
 | typeHints |  | String | Adds type hints to the resulting XML to aid conversion back to JSON. Used for unmarshalling (JSON to XML conversion).
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java b/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
index be34928..6acf6cf 100644
--- a/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
+++ b/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
@@ -56,6 +56,7 @@ public class XmlJsonDataFormat extends ServiceSupport implements DataFormat, Dat
     private Boolean removeNamespacePrefixes;
     private List<String> expandableProperties;
     private TypeHintsEnum typeHints;
+    private boolean contentTypeHeader = true;
 
     public XmlJsonDataFormat() {
     }
@@ -173,6 +174,13 @@ public class XmlJsonDataFormat extends ServiceSupport implements DataFormat, Dat
         json.write(osw);
         osw.flush();
 
+        if (contentTypeHeader) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/json");
+            }
+        }
     }
 
     /**
@@ -191,7 +199,17 @@ public class XmlJsonDataFormat extends ServiceSupport implements DataFormat, Dat
             toConvert = JSONSerializer.toJSON(jsonString);
         }
 
-        return convertToXMLUsingEncoding(toConvert);
+        Object answer = convertToXMLUsingEncoding(toConvert);
+
+        if (contentTypeHeader) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            }
+        }
+
+        return answer;
     }
 
     private String convertToXMLUsingEncoding(JSON json) {
@@ -334,6 +352,19 @@ public class XmlJsonDataFormat extends ServiceSupport implements DataFormat, Dat
         return arrayName;
     }
 
+
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then XmlJson will set the Content-Type header to <tt>application/json</tt> when marshalling,
+     * and <tt>application/xml</tt> when unmarshalling.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
     /**
      * See {@link XMLSerializer#setExpandableProperties(String[])}
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormatTest.java
----------------------------------------------------------------------
diff --git a/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormatTest.java b/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormatTest.java
index d2749e9..27c3bfc 100644
--- a/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormatTest.java
+++ b/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormatTest.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXSource;
 
+import org.apache.camel.Exchange;
 import org.w3c.dom.Document;
 
 import net.sf.json.JSON;
@@ -48,10 +49,12 @@ public class XmlJsonDataFormatTest extends AbstractJsonTestSupport {
 
         MockEndpoint mockJSON = getMockEndpoint("mock:json");
         mockJSON.expectedMessageCount(1);
+        mockJSON.expectedHeaderReceived(Exchange.CONTENT_TYPE, "application/json");
         mockJSON.message(0).body().isInstanceOf(byte[].class);
 
         MockEndpoint mockXML = getMockEndpoint("mock:xml");
         mockXML.expectedMessageCount(1);
+        mockXML.expectedHeaderReceived(Exchange.CONTENT_TYPE, "application/xml");
         mockXML.message(0).body().isInstanceOf(String.class);
 
         Object json = template.requestBody("direct:marshal", in);

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xmlrpc/src/main/docs/xmlrpc-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-xmlrpc/src/main/docs/xmlrpc-dataformat.adoc b/components/camel-xmlrpc/src/main/docs/xmlrpc-dataformat.adoc
index a7436c3..160087a 100644
--- a/components/camel-xmlrpc/src/main/docs/xmlrpc-dataformat.adoc
+++ b/components/camel-xmlrpc/src/main/docs/xmlrpc-dataformat.adoc
@@ -41,7 +41,7 @@ XmlRpc Dataformat Options
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 // dataformat options: START
-The XML RPC dataformat supports 1 options which are listed below.
+The XML RPC dataformat supports 2 options which are listed below.
 
 
 
@@ -50,6 +50,7 @@ The XML RPC dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | request | false | Boolean | Whether to marshal/unmarshal request or response Is by default false
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xmlsecurity/src/main/docs/secureXML-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-xmlsecurity/src/main/docs/secureXML-dataformat.adoc b/components/camel-xmlsecurity/src/main/docs/secureXML-dataformat.adoc
index 5d65c99..b9deac1 100644
--- a/components/camel-xmlsecurity/src/main/docs/secureXML-dataformat.adoc
+++ b/components/camel-xmlsecurity/src/main/docs/secureXML-dataformat.adoc
@@ -40,7 +40,7 @@ XMLSecurity Options
 ^^^^^^^^^^^^^^^^^^^
 
 // dataformat options: START
-The XML Security dataformat supports 11 options which are listed below.
+The XML Security dataformat supports 12 options which are listed below.
 
 
 
@@ -59,6 +59,7 @@ The XML Security dataformat supports 11 options which are listed below.
 | digestAlgorithm | SHA1 | String | The digest algorithm to use with the RSA OAEP algorithm. The available choices are: XMLCipher.SHA1 XMLCipher.SHA256 XMLCipher.SHA512 The default value is XMLCipher.SHA1
 | mgfAlgorithm | MGF1_SHA1 | String | The MGF Algorithm to use with the RSA OAEP algorithm. The available choices are: EncryptionConstants.MGF1_SHA1 EncryptionConstants.MGF1_SHA256 EncryptionConstants.MGF1_SHA512 The default value is EncryptionConstants.MGF1_SHA1
 | addKeyValueForEncryptedKey | true | Boolean | Whether to add the public key used to encrypt the session key as a KeyValue in the EncryptedKey structure or not.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xstream/src/main/docs/json-xstream-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-xstream/src/main/docs/json-xstream-dataformat.adoc b/components/camel-xstream/src/main/docs/json-xstream-dataformat.adoc
index 6faf974..9b878c3 100644
--- a/components/camel-xstream/src/main/docs/json-xstream-dataformat.adoc
+++ b/components/camel-xstream/src/main/docs/json-xstream-dataformat.adoc
@@ -27,7 +27,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The JSon XStream dataformat supports 16 options which are listed below.
+The JSon XStream dataformat supports 17 options which are listed below.
 
 
 
@@ -51,6 +51,7 @@ The JSon XStream dataformat supports 16 options which are listed below.
 | disableFeatures |  | String | Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature com.fasterxml.jackson.databind.DeserializationFeature or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma
 | permissions |  | String | Adds permissions that controls which Java packages and classes XStream is allowed to use during unmarshal from xml/json to Java beans. A permission must be configured either here or globally using a JVM system property. The permission can be specified in a syntax where a plus sign is allow and minus sign is deny. Wildcards is supported by using . as prefix. For example to allow com.foo and all subpackages then specfy com.foo.. Multiple permissions can be configured separated by comma such as com.foo.-com.foo.bar.MySecretBean. The following default permission is always included: -java.lang.java.util. unless its overridden by specifying a JVM system property with they key org.apache.camel.xstream.permissions.
 | allowUnmarshallType | false | Boolean | If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xstream/src/main/docs/xstream-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-xstream/src/main/docs/xstream-dataformat.adoc b/components/camel-xstream/src/main/docs/xstream-dataformat.adoc
index ea7e217..9155f46 100644
--- a/components/camel-xstream/src/main/docs/xstream-dataformat.adoc
+++ b/components/camel-xstream/src/main/docs/xstream-dataformat.adoc
@@ -27,7 +27,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The XStream dataformat supports 9 options which are listed below.
+The XStream dataformat supports 10 options which are listed below.
 
 
 
@@ -44,6 +44,7 @@ The XStream dataformat supports 9 options which are listed below.
 | aliases |  | Map | Alias a Class to a shorter name to be used in XML elements.
 | omitFields |  | Map | Prevents a field from being serialized. To omit a field you must always provide the declaring type and not necessarily the type that is converted.
 | implicitCollections |  | Map | Adds a default implicit collection which is used for any unmapped XML tag.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java
----------------------------------------------------------------------
diff --git a/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java b/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java
index 41d6d7a..c7dd42b 100644
--- a/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java
+++ b/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java
@@ -62,6 +62,7 @@ public abstract class AbstractXStreamWrapper extends ServiceSupport implements D
     private Map<String, String[]> implicitCollections;
     private String permissions;
     private String mode;
+    private boolean contentTypeHeader = true;
 
     public AbstractXStreamWrapper() {
     }
@@ -320,6 +321,19 @@ public abstract class AbstractXStreamWrapper extends ServiceSupport implements D
         this.mode = mode;
     }
 
+
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then XStream will set the Content-Type header to <tt>application/json</tt> when marshalling to JSon
+     * and <tt>application/xml</tt> when marshalling to XML.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
     public XStream getXstream() {
         return xstream;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java b/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
index 4904b15..6252c8b 100644
--- a/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
+++ b/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
@@ -69,6 +69,19 @@ public class JsonDataFormat extends AbstractXStreamWrapper {
     }
 
     @Override
+    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
+        super.marshal(exchange, body, stream);
+
+        if (isContentTypeHeader()) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/json");
+            }
+        }
+    }
+
+    @Override
     protected XStream createXStream(ClassResolver resolver, ClassLoader classLoader) {
         XStream xs = super.createXStream(resolver, classLoader);
         if (getMode() != null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java b/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java
index 84169dc..eb2d13b 100644
--- a/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java
+++ b/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java
@@ -64,6 +64,19 @@ public class XStreamDataFormat extends AbstractXStreamWrapper  {
         return encoding;
     }
 
+    @Override
+    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
+        super.marshal(exchange, body, stream);
+
+        if (isContentTypeHeader()) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            }
+        }
+    }
+
     /**
      * A factory method which takes a collection of types to be annotated
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-zipfile/src/main/docs/zipfile-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/src/main/docs/zipfile-dataformat.adoc b/components/camel-zipfile/src/main/docs/zipfile-dataformat.adoc
index 0b1e10d..1f71e8a 100644
--- a/components/camel-zipfile/src/main/docs/zipfile-dataformat.adoc
+++ b/components/camel-zipfile/src/main/docs/zipfile-dataformat.adoc
@@ -21,7 +21,7 @@ ZipFile Options
 
 
 // dataformat options: START
-The Zip File dataformat supports 1 options which are listed below.
+The Zip File dataformat supports 2 options which are listed below.
 
 
 
@@ -30,6 +30,7 @@ The Zip File dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | usingIterator | false | Boolean | If the zip file has more then one entry the setting this option to true allows to work with the splitter EIP to split the data using an iterator in a streaming mode.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END


[2/3] camel git commit: CAMEL-10633: Data formats marshal to xml/json now set content-type header by default.

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatConfiguration.java b/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatConfiguration.java
index 891e303..013bdc0 100644
--- a/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatConfiguration.java
+++ b/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatConfiguration.java
@@ -102,6 +102,13 @@ public class XmlJsonDataFormatConfiguration {
      * for unmarshalling (JSON to XML conversion).
      */
     private String typeHints;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getEncoding() {
         return encoding;
@@ -198,4 +205,12 @@ public class XmlJsonDataFormatConfiguration {
     public void setTypeHints(String typeHints) {
         this.typeHints = typeHints;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatConfiguration.java b/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatConfiguration.java
index 0311c42..b13729f 100644
--- a/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatConfiguration.java
+++ b/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatConfiguration.java
@@ -30,6 +30,13 @@ public class XmlRpcDataFormatConfiguration {
      * Whether to marshal/unmarshal request or response Is by default false
      */
     private Boolean request = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getRequest() {
         return request;
@@ -38,4 +45,12 @@ public class XmlRpcDataFormatConfiguration {
     public void setRequest(Boolean request) {
         this.request = request;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatConfiguration.java b/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatConfiguration.java
index f42c34b..9c725c7 100644
--- a/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatConfiguration.java
+++ b/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatConfiguration.java
@@ -97,6 +97,13 @@ public class XMLSecurityDataFormatConfiguration {
      * KeyValue in the EncryptedKey structure or not.
      */
     private Boolean addKeyValueForEncryptedKey = true;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getXmlCipherAlgorithm() {
         return xmlCipherAlgorithm;
@@ -186,4 +193,12 @@ public class XMLSecurityDataFormatConfiguration {
     public void setAddKeyValueForEncryptedKey(Boolean addKeyValueForEncryptedKey) {
         this.addKeyValueForEncryptedKey = addKeyValueForEncryptedKey;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatConfiguration.java b/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatConfiguration.java
index 5711cd8..522c52e 100644
--- a/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatConfiguration.java
+++ b/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatConfiguration.java
@@ -128,6 +128,13 @@ public class JsonDataFormatConfiguration {
      * only be enabled when desired to be used.
      */
     private Boolean allowUnmarshallType = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getObjectMapper() {
         return objectMapper;
@@ -256,4 +263,12 @@ public class JsonDataFormatConfiguration {
     public void setAllowUnmarshallType(Boolean allowUnmarshallType) {
         this.allowUnmarshallType = allowUnmarshallType;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatConfiguration.java b/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatConfiguration.java
index 53a2ce0..8e953c6 100644
--- a/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatConfiguration.java
+++ b/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatConfiguration.java
@@ -84,6 +84,13 @@ public class XStreamDataFormatConfiguration {
      * tag.
      */
     private Map<String, String[]> implicitCollections;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getPermissions() {
         return permissions;
@@ -156,4 +163,12 @@ public class XStreamDataFormatConfiguration {
     public void setImplicitCollections(Map<String, String[]> implicitCollections) {
         this.implicitCollections = implicitCollections;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatConfiguration.java b/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatConfiguration.java
index 295c99b..f21f0ad 100644
--- a/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatConfiguration.java
+++ b/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatConfiguration.java
@@ -32,6 +32,13 @@ public class ZipFileDataFormatConfiguration {
      * in a streaming mode.
      */
     private Boolean usingIterator = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getUsingIterator() {
         return usingIterator;
@@ -40,4 +47,12 @@ public class ZipFileDataFormatConfiguration {
     public void setUsingIterator(Boolean usingIterator) {
         this.usingIterator = usingIterator;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-avro/src/main/docs/avro-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-avro/src/main/docs/avro-dataformat.adoc b/components/camel-avro/src/main/docs/avro-dataformat.adoc
index f474baf..38058da 100644
--- a/components/camel-avro/src/main/docs/avro-dataformat.adoc
+++ b/components/camel-avro/src/main/docs/avro-dataformat.adoc
@@ -137,7 +137,7 @@ Avro Dataformat Options
 ^^^^^^^^^^^^^^^^^^^^^^^
 
 // dataformat options: START
-The Avro dataformat supports 1 options which are listed below.
+The Avro dataformat supports 2 options which are listed below.
 
 
 
@@ -146,6 +146,7 @@ The Avro dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | instanceClassName |  | String | Class name to use for marshal and unmarshalling
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-barcode/src/main/docs/barcode-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-barcode/src/main/docs/barcode-dataformat.adoc b/components/camel-barcode/src/main/docs/barcode-dataformat.adoc
index 86888cb..bea27df 100644
--- a/components/camel-barcode/src/main/docs/barcode-dataformat.adoc
+++ b/components/camel-barcode/src/main/docs/barcode-dataformat.adoc
@@ -35,7 +35,7 @@ Barcode Options
 ^^^^^^^^^^^^^^^
 
 // dataformat options: START
-The Barcode dataformat supports 4 options which are listed below.
+The Barcode dataformat supports 5 options which are listed below.
 
 
 
@@ -47,6 +47,7 @@ The Barcode dataformat supports 4 options which are listed below.
 | height |  | Integer | Height of the barcode
 | imageType |  | String | Image type of the barcode such as png
 | barcodeFormat |  | String | Barcode format such as QR-Code
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-base64/src/main/docs/base64-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-base64/src/main/docs/base64-dataformat.adoc b/components/camel-base64/src/main/docs/base64-dataformat.adoc
index f0d76cd..910160d 100644
--- a/components/camel-base64/src/main/docs/base64-dataformat.adoc
+++ b/components/camel-base64/src/main/docs/base64-dataformat.adoc
@@ -11,7 +11,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The Base64 dataformat supports 3 options which are listed below.
+The Base64 dataformat supports 4 options which are listed below.
 
 
 
@@ -22,6 +22,7 @@ The Base64 dataformat supports 3 options which are listed below.
 | lineLength | 76 | Integer | To specific a maximum line length for the encoded data. By default 76 is used.
 | lineSeparator | \r\n | String | The line separators to use. By default \r\n is used.
 | urlSafe | false | Boolean | Instead of emitting '' and '/' we emit '-' and '_' respectively. urlSafe is only applied to encode operations. Decoding seamlessly handles both modes. Is by default false.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-beanio/src/main/docs/beanio-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-beanio/src/main/docs/beanio-dataformat.adoc b/components/camel-beanio/src/main/docs/beanio-dataformat.adoc
index 160178d..1a05410 100644
--- a/components/camel-beanio/src/main/docs/beanio-dataformat.adoc
+++ b/components/camel-beanio/src/main/docs/beanio-dataformat.adoc
@@ -18,7 +18,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The BeanIO dataformat supports 7 options which are listed below.
+The BeanIO dataformat supports 8 options which are listed below.
 
 
 
@@ -33,6 +33,7 @@ The BeanIO dataformat supports 7 options which are listed below.
 | ignoreInvalidRecords | false | Boolean | Whether to ignore invalid records.
 | encoding |  | String | The charset to use. Is by default the JVM platform default charset.
 | beanReaderErrorHandlerType |  | String | To use a custom org.apache.camel.dataformat.beanio.BeanIOErrorHandler as error handler while parsing. Configure the fully qualified class name of the error handler. Notice the options ignoreUnidentifiedRecords ignoreUnexpectedRecords and ignoreInvalidRecords may not be in use when you use a custom error handler.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-bindy/src/main/docs/bindy-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-bindy/src/main/docs/bindy-dataformat.adoc b/components/camel-bindy/src/main/docs/bindy-dataformat.adoc
index a4918fb..71b2746 100644
--- a/components/camel-bindy/src/main/docs/bindy-dataformat.adoc
+++ b/components/camel-bindy/src/main/docs/bindy-dataformat.adoc
@@ -66,7 +66,7 @@ Options
 
 
 // dataformat options: START
-The Bindy dataformat supports 3 options which are listed below.
+The Bindy dataformat supports 4 options which are listed below.
 
 
 
@@ -77,6 +77,7 @@ The Bindy dataformat supports 3 options which are listed below.
 | type |  | BindyType | Whether to use csv fixed or key value pairs mode. The default value is either Csv or KeyValue depending on chosen dataformat.
 | classType |  | String | Name of model class to use.
 | locale |  | String | To configure a default locale to use such as us for united states. To use the JVM platform default locale then use the name default
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-boon/src/main/docs/boon-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-boon/src/main/docs/boon-dataformat.adoc b/components/camel-boon/src/main/docs/boon-dataformat.adoc
index 834cdb7..7818770 100644
--- a/components/camel-boon/src/main/docs/boon-dataformat.adoc
+++ b/components/camel-boon/src/main/docs/boon-dataformat.adoc
@@ -20,7 +20,7 @@ Options
 
 
 // dataformat options: START
-The Boon dataformat supports 2 options which are listed below.
+The Boon dataformat supports 3 options which are listed below.
 
 
 
@@ -30,6 +30,7 @@ The Boon dataformat supports 2 options which are listed below.
 | Name | Default | Java Type | Description
 | unmarshalTypeName |  | String | Class name of the java type to use when unarmshalling
 | useList | false | Boolean | To unarmshal to a List of Map or a List of Pojo.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-castor/src/main/docs/castor-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-castor/src/main/docs/castor-dataformat.adoc b/components/camel-castor/src/main/docs/castor-dataformat.adoc
index f649094..23489c4 100644
--- a/components/camel-castor/src/main/docs/castor-dataformat.adoc
+++ b/components/camel-castor/src/main/docs/castor-dataformat.adoc
@@ -113,7 +113,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The Castor dataformat supports 5 options which are listed below.
+The Castor dataformat supports 6 options which are listed below.
 
 
 
@@ -126,6 +126,7 @@ The Castor dataformat supports 5 options which are listed below.
 | encoding | UTF-8 | String | Encoding to use when marshalling an Object to XML. Is by default UTF-8
 | packages |  | String[] | Add additional packages to Castor XmlContext
 | classes |  | String[] | Add additional class names to Castor XmlContext
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java b/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
index dee44cc..adbc0ce 100644
--- a/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
+++ b/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
@@ -56,6 +56,7 @@ public abstract class AbstractCastorDataFormat extends ServiceSupport implements
     private String[] packages;
     private boolean validation;
     private volatile XMLContext xmlContext;
+    private boolean contentTypeHeader = true;
 
     public AbstractCastorDataFormat() {
     }
@@ -75,6 +76,14 @@ public abstract class AbstractCastorDataFormat extends ServiceSupport implements
         Marshaller marshaller = createMarshaller(exchange);
         marshaller.setWriter(writer);
         marshaller.marshal(body);
+
+        if (contentTypeHeader) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            }
+        }
     }
 
     public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception {
@@ -174,6 +183,18 @@ public abstract class AbstractCastorDataFormat extends ServiceSupport implements
         this.validation = validation;
     }
 
+
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then Castor will set the Content-Type header to <tt>application/xml</tt> when marshalling.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
     @Override
     protected void doStart() throws Exception {
         if (xmlContext == null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-crypto/src/main/docs/crypto-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-crypto/src/main/docs/crypto-dataformat.adoc b/components/camel-crypto/src/main/docs/crypto-dataformat.adoc
index f252e3a..ae7279a 100644
--- a/components/camel-crypto/src/main/docs/crypto-dataformat.adoc
+++ b/components/camel-crypto/src/main/docs/crypto-dataformat.adoc
@@ -15,7 +15,7 @@ CryptoDataFormat Options
 ^^^^^^^^^^^^^^^^^^^^^^^^
 
 // dataformat options: START
-The Crypto (Java Cryptographic Extension) dataformat supports 9 options which are listed below.
+The Crypto (Java Cryptographic Extension) dataformat supports 10 options which are listed below.
 
 
 
@@ -32,6 +32,7 @@ The Crypto (Java Cryptographic Extension) dataformat supports 9 options which ar
 | macAlgorithm | HmacSHA1 | String | The JCE algorithm name indicating the Message Authentication algorithm.
 | shouldAppendHMAC | false | Boolean | Flag indicating that a Message Authentication Code should be calculated and appended to the encrypted data.
 | inline | false | Boolean | Flag indicating that the configured IV should be inlined into the encrypted data stream. Is by default false.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-crypto/src/main/docs/pgp-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-crypto/src/main/docs/pgp-dataformat.adoc b/components/camel-crypto/src/main/docs/pgp-dataformat.adoc
index 292395d..b1175a4 100644
--- a/components/camel-crypto/src/main/docs/pgp-dataformat.adoc
+++ b/components/camel-crypto/src/main/docs/pgp-dataformat.adoc
@@ -15,7 +15,7 @@ PGPDataFormat Options
 ^^^^^^^^^^^^^^^^^^^^^
 
 // dataformat options: START
-The PGP dataformat supports 14 options which are listed below.
+The PGP dataformat supports 15 options which are listed below.
 
 
 
@@ -37,6 +37,7 @@ The PGP dataformat supports 14 options which are listed below.
 | compressionAlgorithm |  | Integer | Compression algorithm; possible values are defined in org.bouncycastle.bcpg.CompressionAlgorithmTags; for example 0 (= UNCOMPRESSED) 1 (= ZIP) 2 (= ZLIB) 3 (= BZIP2). Only relevant for encrypting.
 | hashAlgorithm |  | Integer | Signature hash algorithm; possible values are defined in org.bouncycastle.bcpg.HashAlgorithmTags; for example 2 (= SHA1) 8 (= SHA256) 9 (= SHA384) 10 (= SHA512) 11 (=SHA224). Only relevant for signing.
 | signatureVerificationOption |  | String | Controls the behavior for verifying the signature during unmarshaling. There are 4 values possible: optional: The PGP message may or may not contain signatures; if it does contain signatures then a signature verification is executed. required: The PGP message must contain at least one signature; if this is not the case an exception (PGPException) is thrown. A signature verification is executed. ignore: Contained signatures in the PGP message are ignored; no signature verification is executed. no_signature_allowed: The PGP message must not contain a signature; otherwise an exception (PGPException) is thrown.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-csv/src/main/docs/csv-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-csv/src/main/docs/csv-dataformat.adoc b/components/camel-csv/src/main/docs/csv-dataformat.adoc
index b10793a..5c03a20 100644
--- a/components/camel-csv/src/main/docs/csv-dataformat.adoc
+++ b/components/camel-csv/src/main/docs/csv-dataformat.adoc
@@ -13,7 +13,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The CSV dataformat supports 23 options which are listed below.
+The CSV dataformat supports 24 options which are listed below.
 
 
 
@@ -44,6 +44,7 @@ The CSV dataformat supports 23 options which are listed below.
 | lazyLoad | false | Boolean | Whether the unmarshalling should produce an iterator that reads the lines on the fly or if all the lines must be read at one.
 | useMaps | false | Boolean | Whether the unmarshalling should produce maps for the lines values instead of lists. It requires to have header (either defined or collected).
 | recordConverterRef |  | String | Refers to a custom CsvRecordConverter to lookup from the registry to use.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-flatpack/src/main/docs/flatpack-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-flatpack/src/main/docs/flatpack-dataformat.adoc b/components/camel-flatpack/src/main/docs/flatpack-dataformat.adoc
index 1892521..d7b0025 100644
--- a/components/camel-flatpack/src/main/docs/flatpack-dataformat.adoc
+++ b/components/camel-flatpack/src/main/docs/flatpack-dataformat.adoc
@@ -23,7 +23,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The Flatpack dataformat supports 8 options which are listed below.
+The Flatpack dataformat supports 9 options which are listed below.
 
 
 
@@ -39,6 +39,7 @@ The Flatpack dataformat supports 8 options which are listed below.
 | delimiter | , | String | The delimiter char (could be ; or similar)
 | allowShortLines | false | Boolean | Allows for lines to be shorter than expected and ignores the extra characters
 | ignoreExtraColumns | false | Boolean | Allows for lines to be longer than expected and ignores the extra characters.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-gson/src/main/docs/json-gson-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-gson/src/main/docs/json-gson-dataformat.adoc b/components/camel-gson/src/main/docs/json-gson-dataformat.adoc
index cb83a73..7a02584 100644
--- a/components/camel-gson/src/main/docs/json-gson-dataformat.adoc
+++ b/components/camel-gson/src/main/docs/json-gson-dataformat.adoc
@@ -20,7 +20,7 @@ Gson Options
 
 
 // dataformat options: START
-The JSon GSon dataformat supports 16 options which are listed below.
+The JSon GSon dataformat supports 17 options which are listed below.
 
 
 
@@ -44,6 +44,7 @@ The JSon GSon dataformat supports 16 options which are listed below.
 | disableFeatures |  | String | Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature com.fasterxml.jackson.databind.DeserializationFeature or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma
 | permissions |  | String | Adds permissions that controls which Java packages and classes XStream is allowed to use during unmarshal from xml/json to Java beans. A permission must be configured either here or globally using a JVM system property. The permission can be specified in a syntax where a plus sign is allow and minus sign is deny. Wildcards is supported by using . as prefix. For example to allow com.foo and all subpackages then specfy com.foo.. Multiple permissions can be configured separated by comma such as com.foo.-com.foo.bar.MySecretBean. The following default permission is always included: -java.lang.java.util. unless its overridden by specifying a JVM system property with they key org.apache.camel.xstream.permissions.
 | allowUnmarshallType | false | Boolean | If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java b/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
index e480c5d..a66e876 100644
--- a/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
+++ b/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
@@ -54,6 +54,7 @@ public class GsonDataFormat extends ServiceSupport implements DataFormat, DataFo
     private boolean serializeNulls;
     private boolean prettyPrint;
     private String dateFormatPattern;
+    private boolean contentTypeHeader = true;
 
     public GsonDataFormat() {
         this(Object.class);
@@ -126,6 +127,14 @@ public class GsonDataFormat extends ServiceSupport implements DataFormat, DataFo
              final BufferedWriter writer = IOHelper.buffered(osw)) {
             gson.toJson(graph, writer);
         }
+
+        if (contentTypeHeader) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/json");
+            }
+        }
     }
 
     @Override
@@ -282,6 +291,18 @@ public class GsonDataFormat extends ServiceSupport implements DataFormat, DataFo
         this.dateFormatPattern = dateFormatPattern;
     }
 
+
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then Gson will set the Content-Type header to <tt>application/json</tt> when marshalling.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
     public Gson getGson() {
         return this.gson;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-hessian/src/main/docs/hessian-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-hessian/src/main/docs/hessian-dataformat.adoc b/components/camel-hessian/src/main/docs/hessian-dataformat.adoc
index 77ac570..deac736 100644
--- a/components/camel-hessian/src/main/docs/hessian-dataformat.adoc
+++ b/components/camel-hessian/src/main/docs/hessian-dataformat.adoc
@@ -21,7 +21,17 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The Hessian dataformat has no options.
+The Hessian dataformat supports 1 options which are listed below.
+
+
+
+{% raw %}
+[width="100%",cols="2s,1m,1m,6",options="header"]
+|=======================================================================
+| Name | Default | Java Type | Description
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
+|=======================================================================
+{% endraw %}
 // dataformat options: END
 
 [[hessian-UsingHessianDataFormat]]

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-hl7/src/main/docs/hl7-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-hl7/src/main/docs/hl7-dataformat.adoc b/components/camel-hl7/src/main/docs/hl7-dataformat.adoc
index d0b340c..d63f43a 100644
--- a/components/camel-hl7/src/main/docs/hl7-dataformat.adoc
+++ b/components/camel-hl7/src/main/docs/hl7-dataformat.adoc
@@ -222,7 +222,7 @@ The link:hl7.html[HL7] component ships with a HL7 data format that can
 be used to marshal or unmarshal HL7 model objects.
 
 // dataformat options: START
-The HL7 dataformat supports 1 options which are listed below.
+The HL7 dataformat supports 2 options which are listed below.
 
 
 
@@ -231,6 +231,7 @@ The HL7 dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | validate | true | Boolean | Whether to validate the HL7 message Is by default true.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-ical/src/main/docs/ical-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-ical/src/main/docs/ical-dataformat.adoc b/components/camel-ical/src/main/docs/ical-dataformat.adoc
index 1bca47d..322dbb9 100644
--- a/components/camel-ical/src/main/docs/ical-dataformat.adoc
+++ b/components/camel-ical/src/main/docs/ical-dataformat.adoc
@@ -33,7 +33,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The iCal dataformat supports 1 options which are listed below.
+The iCal dataformat supports 2 options which are listed below.
 
 
 
@@ -42,6 +42,7 @@ The iCal dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | validating | false | Boolean | Whether to validate.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jackson/src/main/docs/json-jackson-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/main/docs/json-jackson-dataformat.adoc b/components/camel-jackson/src/main/docs/json-jackson-dataformat.adoc
index f8c2106..9766dce 100644
--- a/components/camel-jackson/src/main/docs/json-jackson-dataformat.adoc
+++ b/components/camel-jackson/src/main/docs/json-jackson-dataformat.adoc
@@ -21,7 +21,7 @@ Jackson Options
 
 
 // dataformat options: START
-The JSon Jackson dataformat supports 16 options which are listed below.
+The JSon Jackson dataformat supports 17 options which are listed below.
 
 
 
@@ -45,6 +45,7 @@ The JSon Jackson dataformat supports 16 options which are listed below.
 | disableFeatures |  | String | Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature com.fasterxml.jackson.databind.DeserializationFeature or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma
 | permissions |  | String | Adds permissions that controls which Java packages and classes XStream is allowed to use during unmarshal from xml/json to Java beans. A permission must be configured either here or globally using a JVM system property. The permission can be specified in a syntax where a plus sign is allow and minus sign is deny. Wildcards is supported by using . as prefix. For example to allow com.foo and all subpackages then specfy com.foo.. Multiple permissions can be configured separated by comma such as com.foo.-com.foo.bar.MySecretBean. The following default permission is always included: -java.lang.java.util. unless its overridden by specifying a JVM system property with they key org.apache.camel.xstream.permissions.
 | allowUnmarshallType | false | Boolean | If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java
index ec7073f..31ff280 100644
--- a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java
+++ b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java
@@ -69,6 +69,7 @@ public class JacksonDataFormat extends ServiceSupport implements DataFormat, Dat
     private String disableFeatures;
     private boolean enableJacksonTypeConverter;
     private boolean allowUnmarshallType;
+    private boolean contentTypeHeader = true;
 
     /**
      * Use the default Jackson {@link ObjectMapper} and {@link Object}
@@ -153,6 +154,14 @@ public class JacksonDataFormat extends ServiceSupport implements DataFormat, Dat
 
     public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception {
         this.objectMapper.writerWithView(jsonView).writeValue(stream, graph);
+
+        if (contentTypeHeader) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/json");
+            }
+        }
     }
 
     public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
@@ -344,6 +353,17 @@ public class JacksonDataFormat extends ServiceSupport implements DataFormat, Dat
         this.allowUnmarshallType = allowJacksonUnmarshallType;
     }
 
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then Jackson will set the Content-Type header to <tt>application/json</tt> when marshalling.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
     public String getEnableFeatures() {
         return enableFeatures;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalContentTypeHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalContentTypeHeaderTest.java b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalContentTypeHeaderTest.java
new file mode 100644
index 0000000..c66bf9d
--- /dev/null
+++ b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalContentTypeHeaderTest.java
@@ -0,0 +1,100 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jackson;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.dataformat.JsonLibrary;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class JacksonMarshalContentTypeHeaderTest extends CamelTestSupport {
+
+    @Test
+    public void testYes() throws Exception {
+        final Map<String, Object> in = new HashMap<String, Object>();
+        in.put("name", "Camel");
+
+        Exchange out = template.request("direct:yes", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody(in);
+            }
+        });
+
+        assertNotNull(out);
+        assertTrue(out.hasOut());
+        assertEquals("application/json", out.getOut().getHeader(Exchange.CONTENT_TYPE));
+    }
+
+    @Test
+    public void testYes2() throws Exception {
+        final Map<String, Object> in = new HashMap<String, Object>();
+        in.put("name", "Camel");
+
+        Exchange out = template.request("direct:yes2", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody(in);
+            }
+        });
+
+        assertNotNull(out);
+        assertTrue(out.hasOut());
+        assertEquals("application/json", out.getOut().getHeader(Exchange.CONTENT_TYPE));
+    }
+
+    @Test
+    public void testNo() throws Exception {
+        final Map<String, Object> in = new HashMap<String, Object>();
+        in.put("name", "Camel");
+
+        Exchange out = template.request("direct:no", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody(in);
+            }
+        });
+
+        assertNotNull(out);
+        assertTrue(out.hasOut());
+        assertNull(out.getOut().getHeader(Exchange.CONTENT_TYPE));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+
+            @Override
+            public void configure() throws Exception {
+                JacksonDataFormat format = new JacksonDataFormat();
+                from("direct:yes").marshal(format);
+
+                from("direct:yes2").marshal().json(JsonLibrary.Jackson);
+
+                JacksonDataFormat formatNoHeader = new JacksonDataFormat();
+                formatNoHeader.setContentTypeHeader(false);
+                from("direct:no").marshal(formatNoHeader);
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jacksonxml/src/main/docs/jacksonxml-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-jacksonxml/src/main/docs/jacksonxml-dataformat.adoc b/components/camel-jacksonxml/src/main/docs/jacksonxml-dataformat.adoc
index 85c362e..28128a3 100644
--- a/components/camel-jacksonxml/src/main/docs/jacksonxml-dataformat.adoc
+++ b/components/camel-jacksonxml/src/main/docs/jacksonxml-dataformat.adoc
@@ -36,7 +36,7 @@ JacksonXML Options
 
 
 // dataformat options: START
-The JacksonXML dataformat supports 14 options which are listed below.
+The JacksonXML dataformat supports 15 options which are listed below.
 
 
 
@@ -58,6 +58,7 @@ The JacksonXML dataformat supports 14 options which are listed below.
 | enableFeatures |  | String | Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature com.fasterxml.jackson.databind.DeserializationFeature or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma
 | disableFeatures |  | String | Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature com.fasterxml.jackson.databind.DeserializationFeature or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma
 | allowUnmarshallType | false | Boolean | If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java b/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java
index dd70cd5..eeaddcc 100644
--- a/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java
+++ b/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java
@@ -69,6 +69,7 @@ public class JacksonXMLDataFormat extends ServiceSupport implements DataFormat,
     private String disableFeatures;
     private boolean enableJacksonTypeConverter;
     private boolean allowUnmarshallType;
+    private boolean contentTypeHeader = true;
 
     /**
      * Use the default Jackson {@link XmlMapper} and {@link Map}
@@ -153,6 +154,14 @@ public class JacksonXMLDataFormat extends ServiceSupport implements DataFormat,
 
     public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception {
         this.xmlMapper.writerWithView(jsonView).writeValue(stream, graph);
+
+        if (contentTypeHeader) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            }
+        }
     }
 
     public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
@@ -344,6 +353,17 @@ public class JacksonXMLDataFormat extends ServiceSupport implements DataFormat,
         this.allowUnmarshallType = allowJacksonUnmarshallType;
     }
 
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then Jackson will set the Content-Type header to <tt>application/xml</tt> when marshalling.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
     public String getEnableFeatures() {
         return enableFeatures;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jacksonxml/src/test/java/org/apache/camel/component/jacksonxml/JacksonMarshalContentTypeHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jacksonxml/src/test/java/org/apache/camel/component/jacksonxml/JacksonMarshalContentTypeHeaderTest.java b/components/camel-jacksonxml/src/test/java/org/apache/camel/component/jacksonxml/JacksonMarshalContentTypeHeaderTest.java
new file mode 100644
index 0000000..82a65c8
--- /dev/null
+++ b/components/camel-jacksonxml/src/test/java/org/apache/camel/component/jacksonxml/JacksonMarshalContentTypeHeaderTest.java
@@ -0,0 +1,99 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jacksonxml;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class JacksonMarshalContentTypeHeaderTest extends CamelTestSupport {
+
+    @Test
+    public void testYes() throws Exception {
+        final Map<String, Object> in = new HashMap<String, Object>();
+        in.put("name", "Camel");
+
+        Exchange out = template.request("direct:yes", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody(in);
+            }
+        });
+
+        assertNotNull(out);
+        assertTrue(out.hasOut());
+        assertEquals("application/xml", out.getOut().getHeader(Exchange.CONTENT_TYPE));
+    }
+
+    @Test
+    public void testYes2() throws Exception {
+        final Map<String, Object> in = new HashMap<String, Object>();
+        in.put("name", "Camel");
+
+        Exchange out = template.request("direct:yes2", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody(in);
+            }
+        });
+
+        assertNotNull(out);
+        assertTrue(out.hasOut());
+        assertEquals("application/xml", out.getOut().getHeader(Exchange.CONTENT_TYPE));
+    }
+
+    @Test
+    public void testNo() throws Exception {
+        final Map<String, Object> in = new HashMap<String, Object>();
+        in.put("name", "Camel");
+
+        Exchange out = template.request("direct:no", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody(in);
+            }
+        });
+
+        assertNotNull(out);
+        assertTrue(out.hasOut());
+        assertNull(out.getOut().getHeader(Exchange.CONTENT_TYPE));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+
+            @Override
+            public void configure() throws Exception {
+                JacksonXMLDataFormat format = new JacksonXMLDataFormat();
+                from("direct:yes").marshal(format);
+
+                from("direct:yes2").marshal().jacksonxml();
+
+                JacksonXMLDataFormat formatNoHeader = new JacksonXMLDataFormat();
+                formatNoHeader.setContentTypeHeader(false);
+                from("direct:no").marshal(formatNoHeader);
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jaxb/src/main/docs/jaxb-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-jaxb/src/main/docs/jaxb-dataformat.adoc b/components/camel-jaxb/src/main/docs/jaxb-dataformat.adoc
index 1fe8e36..27a688f 100644
--- a/components/camel-jaxb/src/main/docs/jaxb-dataformat.adoc
+++ b/components/camel-jaxb/src/main/docs/jaxb-dataformat.adoc
@@ -12,7 +12,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The JAXB dataformat supports 16 options which are listed below.
+The JAXB dataformat supports 17 options which are listed below.
 
 
 
@@ -36,6 +36,7 @@ The JAXB dataformat supports 16 options which are listed below.
 | schemaLocation |  | String | To define the location of the schema
 | noNamespaceSchemaLocation |  | String | To define the location of the namespaceless schema
 | jaxbProviderProperties |  | String | Refers to a custom java.util.Map to lookup in the registry containing custom JAXB provider properties to be used with the JAXB marshaller.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
index fbd6636..9506b5e 100644
--- a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
+++ b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
@@ -106,6 +106,7 @@ public class JaxbDataFormat extends ServiceSupport implements DataFormat, DataFo
     private TypeConverter typeConverter;
     private Schema cachedSchema;
     private Map<String, Object> jaxbProviderProperties;
+    private boolean contentTypeHeader = true;
 
     public JaxbDataFormat() {
     }
@@ -166,6 +167,13 @@ public class JaxbDataFormat extends ServiceSupport implements DataFormat, DataFo
             }
             marshal(exchange, graph, stream, marshaller);
 
+            if (contentTypeHeader) {
+                if (exchange.hasOut()) {
+                    exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+                } else {
+                    exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+                }
+            }
         } catch (Exception e) {
             throw new IOException(e);
         }
@@ -438,6 +446,18 @@ public class JaxbDataFormat extends ServiceSupport implements DataFormat, DataFo
         this.jaxbProviderProperties = jaxbProviderProperties;
     }
 
+
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then JAXB will set the Content-Type header to <tt>application/xml</tt> when marshalling.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
     @Override
     @SuppressWarnings("unchecked")
     protected void doStart() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java b/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java
index 1c7a812..8762925 100644
--- a/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java
+++ b/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.jaxb;
 import javax.xml.bind.JAXBElement;
 
 import org.apache.camel.CamelExecutionException;
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.converter.jaxb.JaxbDataFormat;
@@ -86,6 +87,7 @@ public class CamelJaxbTest extends CamelTestSupport {
 
         MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
         resultEndpoint.expectedMessageCount(1);
+        resultEndpoint.expectedHeaderReceived(Exchange.CONTENT_TYPE, "application/xml");
         template.sendBody("direct:marshal", person);
         resultEndpoint.assertIsSatisfied();
 
@@ -102,6 +104,7 @@ public class CamelJaxbTest extends CamelTestSupport {
 
         MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
         resultEndpoint.expectedMessageCount(1);
+        resultEndpoint.expectedHeaderReceived(Exchange.CONTENT_TYPE, "application/xml");
         template.sendBody("direct:marshal", person);
         resultEndpoint.assertIsSatisfied();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jibx/src/main/docs/jibx-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-jibx/src/main/docs/jibx-dataformat.adoc b/components/camel-jibx/src/main/docs/jibx-dataformat.adoc
index fac8f9e..1abd141 100644
--- a/components/camel-jibx/src/main/docs/jibx-dataformat.adoc
+++ b/components/camel-jibx/src/main/docs/jibx-dataformat.adoc
@@ -33,7 +33,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The JiBX dataformat supports 2 options which are listed below.
+The JiBX dataformat supports 3 options which are listed below.
 
 
 
@@ -43,6 +43,7 @@ The JiBX dataformat supports 2 options which are listed below.
 | Name | Default | Java Type | Description
 | unmarshallClass |  | String | Class name to use when unmarshalling from XML to Java.
 | bindingName |  | String | To use a custom binding factory
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-jibx/src/main/java/org/apache/camel/dataformat/jibx/JibxDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-jibx/src/main/java/org/apache/camel/dataformat/jibx/JibxDataFormat.java b/components/camel-jibx/src/main/java/org/apache/camel/dataformat/jibx/JibxDataFormat.java
index e48daa5..9628c59 100644
--- a/components/camel-jibx/src/main/java/org/apache/camel/dataformat/jibx/JibxDataFormat.java
+++ b/components/camel-jibx/src/main/java/org/apache/camel/dataformat/jibx/JibxDataFormat.java
@@ -35,6 +35,7 @@ public class JibxDataFormat extends ServiceSupport implements DataFormat, DataFo
 
     private Class<?> unmarshallClass;
     private String bindingName;
+    private boolean contentTypeHeader = true;
 
     public JibxDataFormat() {
     }
@@ -57,6 +58,14 @@ public class JibxDataFormat extends ServiceSupport implements DataFormat, DataFo
         IBindingFactory bindingFactory = createBindingFactory(body.getClass(), bindingName);
         IMarshallingContext marshallingContext = bindingFactory.createMarshallingContext();
         marshallingContext.marshalDocument(body, null, null, stream);
+
+        if (contentTypeHeader) {
+            if (exchange.hasOut()) {
+                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            } else {
+                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
+            }
+        }
     }
 
     public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
@@ -72,7 +81,6 @@ public class JibxDataFormat extends ServiceSupport implements DataFormat, DataFo
         return unmarshallingContext.unmarshalDocument(stream, null);
     }
 
-
     @Override
     protected void doStart() throws Exception {
         // noop
@@ -99,6 +107,19 @@ public class JibxDataFormat extends ServiceSupport implements DataFormat, DataFo
         this.bindingName = bindingName;
     }
 
+
+    public boolean isContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * If enabled then Jibx will set the Content-Type header to <tt>application/xml</tt> when marshalling.
+     */
+    public void setContentTypeHeader(boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
+
     private IBindingFactory createBindingFactory(Class<?> clazz, String bindingName) throws JiBXException {
         if (bindingName == null) {
             return BindingDirectory.getFactory(clazz);

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-johnzon/src/main/docs/json-johnzon-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-johnzon/src/main/docs/json-johnzon-dataformat.adoc b/components/camel-johnzon/src/main/docs/json-johnzon-dataformat.adoc
index 416cbf7..95ab41a 100644
--- a/components/camel-johnzon/src/main/docs/json-johnzon-dataformat.adoc
+++ b/components/camel-johnzon/src/main/docs/json-johnzon-dataformat.adoc
@@ -21,7 +21,7 @@ Johnzon Options
 
 
 // dataformat options: START
-The JSon Johnzon dataformat supports 16 options which are listed below.
+The JSon Johnzon dataformat supports 17 options which are listed below.
 
 
 
@@ -45,6 +45,7 @@ The JSon Johnzon dataformat supports 16 options which are listed below.
 | disableFeatures |  | String | Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature com.fasterxml.jackson.databind.DeserializationFeature or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma
 | permissions |  | String | Adds permissions that controls which Java packages and classes XStream is allowed to use during unmarshal from xml/json to Java beans. A permission must be configured either here or globally using a JVM system property. The permission can be specified in a syntax where a plus sign is allow and minus sign is deny. Wildcards is supported by using . as prefix. For example to allow com.foo and all subpackages then specfy com.foo.. Multiple permissions can be configured separated by comma such as com.foo.-com.foo.bar.MySecretBean. The following default permission is always included: -java.lang.java.util. unless its overridden by specifying a JVM system property with they key org.apache.camel.xstream.permissions.
 | allowUnmarshallType | false | Boolean | If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-lzf/src/main/docs/lzf-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-lzf/src/main/docs/lzf-dataformat.adoc b/components/camel-lzf/src/main/docs/lzf-dataformat.adoc
index db09d69..12aa565 100644
--- a/components/camel-lzf/src/main/docs/lzf-dataformat.adoc
+++ b/components/camel-lzf/src/main/docs/lzf-dataformat.adoc
@@ -16,7 +16,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The LZF Deflate Compression dataformat supports 1 options which are listed below.
+The LZF Deflate Compression dataformat supports 2 options which are listed below.
 
 
 
@@ -25,6 +25,7 @@ The LZF Deflate Compression dataformat supports 1 options which are listed below
 |=======================================================================
 | Name | Default | Java Type | Description
 | usingParallelCompression | false | Boolean | Enable encoding (compress) using multiple processing cores.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-mail/src/main/docs/mime-multipart-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-mail/src/main/docs/mime-multipart-dataformat.adoc b/components/camel-mail/src/main/docs/mime-multipart-dataformat.adoc
index cfaa0ca..82f461d 100644
--- a/components/camel-mail/src/main/docs/mime-multipart-dataformat.adoc
+++ b/components/camel-mail/src/main/docs/mime-multipart-dataformat.adoc
@@ -47,7 +47,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The MIME Multipart dataformat supports 5 options which are listed below.
+The MIME Multipart dataformat supports 6 options which are listed below.
 
 
 
@@ -60,6 +60,7 @@ The MIME Multipart dataformat supports 5 options which are listed below.
 | headersInline | false | Boolean | Defines whether the MIME-Multipart headers are part of the message body (true) or are set as Camel headers (false). Default is false.
 | includeHeaders |  | String | A regex that defines which Camel headers are also included as MIME headers into the MIME multipart. This will only work if headersInline is set to true. Default is to include no headers
 | binaryContent | false | Boolean | Defines whether the content of binary parts in the MIME multipart is binary (true) or Base-64 encoded (false) Default is false.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-protobuf/src/main/docs/protobuf-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-protobuf/src/main/docs/protobuf-dataformat.adoc b/components/camel-protobuf/src/main/docs/protobuf-dataformat.adoc
index c6a3a85..d5d9985 100644
--- a/components/camel-protobuf/src/main/docs/protobuf-dataformat.adoc
+++ b/components/camel-protobuf/src/main/docs/protobuf-dataformat.adoc
@@ -25,7 +25,7 @@ Protobuf Options
 ^^^^^^^^^^^^^^^^
 
 // dataformat options: START
-The Protobuf dataformat supports 1 options which are listed below.
+The Protobuf dataformat supports 2 options which are listed below.
 
 
 
@@ -34,6 +34,7 @@ The Protobuf dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | instanceClass |  | String | Name of class to use when unarmshalling
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-rss/src/main/docs/rss-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-rss/src/main/docs/rss-dataformat.adoc b/components/camel-rss/src/main/docs/rss-dataformat.adoc
index 7a6f149..7b6b731 100644
--- a/components/camel-rss/src/main/docs/rss-dataformat.adoc
+++ b/components/camel-rss/src/main/docs/rss-dataformat.adoc
@@ -25,7 +25,17 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The RSS dataformat has no options.
+The RSS dataformat supports 1 options which are listed below.
+
+
+
+{% raw %}
+[width="100%",cols="2s,1m,1m,6",options="header"]
+|=======================================================================
+| Name | Default | Java Type | Description
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
+|=======================================================================
+{% endraw %}
 // dataformat options: END
 
 

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc b/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc
index 702a875..9ec7ebd 100644
--- a/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc
+++ b/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc
@@ -19,7 +19,7 @@ YAML Options
 ^^^^^^^^^^^^
 
 // dataformat options: START
-The YAML SnakeYAML dataformat supports 10 options which are listed below.
+The YAML SnakeYAML dataformat supports 11 options which are listed below.
 
 
 
@@ -37,6 +37,7 @@ The YAML SnakeYAML dataformat supports 10 options which are listed below.
 | prettyFlow | false | Boolean | Force the emitter to produce a pretty YAML document when using the flow style.
 | allowAnyType | false | Boolean | Allow any class to be un-marshaled
 | typeFilter |  | List | Set the types SnakeYAML is allowed to un-marshall
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-soap/src/main/docs/soapjaxb-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-soap/src/main/docs/soapjaxb-dataformat.adoc b/components/camel-soap/src/main/docs/soapjaxb-dataformat.adoc
index de54e65..92d7aea 100644
--- a/components/camel-soap/src/main/docs/soapjaxb-dataformat.adoc
+++ b/components/camel-soap/src/main/docs/soapjaxb-dataformat.adoc
@@ -24,7 +24,7 @@ SOAP Options
 
 
 // dataformat options: START
-The SOAP dataformat supports 6 options which are listed below.
+The SOAP dataformat supports 7 options which are listed below.
 
 
 
@@ -38,6 +38,7 @@ The SOAP dataformat supports 6 options which are listed below.
 | version | 1.1 | String | SOAP version should either be 1.1 or 1.2. Is by default 1.1
 | namespacePrefixRef |  | String | When marshalling using JAXB or SOAP then the JAXB implementation will automatic assign namespace prefixes such as ns2 ns3 ns4 etc. To control this mapping Camel allows you to refer to a map which contains the desired mapping.
 | schema |  | String | To validate against an existing schema. Your can use the prefix classpath: file: or http: to specify how the resource should by resolved. You can separate multiple schema files by using the '' character.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-syslog/src/main/docs/syslog-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-syslog/src/main/docs/syslog-dataformat.adoc b/components/camel-syslog/src/main/docs/syslog-dataformat.adoc
index 51c30c7..263bb41 100644
--- a/components/camel-syslog/src/main/docs/syslog-dataformat.adoc
+++ b/components/camel-syslog/src/main/docs/syslog-dataformat.adoc
@@ -53,7 +53,17 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The Syslog dataformat has no options.
+The Syslog dataformat supports 1 options which are listed below.
+
+
+
+{% raw %}
+[width="100%",cols="2s,1m,1m,6",options="header"]
+|=======================================================================
+| Name | Default | Java Type | Description
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
+|=======================================================================
+{% endraw %}
 // dataformat options: END
 
 [[Syslog-RFC5424Syslogprotocol]]

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-tagsoup/src/main/docs/tidyMarkup-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-tagsoup/src/main/docs/tidyMarkup-dataformat.adoc b/components/camel-tagsoup/src/main/docs/tidyMarkup-dataformat.adoc
index 53970c01..1c11afe 100644
--- a/components/camel-tagsoup/src/main/docs/tidyMarkup-dataformat.adoc
+++ b/components/camel-tagsoup/src/main/docs/tidyMarkup-dataformat.adoc
@@ -24,7 +24,7 @@ TidyMarkup Options
 
 
 // dataformat options: START
-The TidyMarkup dataformat supports 2 options which are listed below.
+The TidyMarkup dataformat supports 3 options which are listed below.
 
 
 
@@ -34,6 +34,7 @@ The TidyMarkup dataformat supports 2 options which are listed below.
 | Name | Default | Java Type | Description
 | dataObjectType | org.w3c.dom.Node | String | What data type to unmarshal as can either be org.w3c.dom.Node or java.lang.String. Is by default org.w3c.dom.Node
 | omitXmlDeclaration | false | Boolean | When returning a String do we omit the XML declaration in the top.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-tarfile/src/main/docs/tarfile-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-tarfile/src/main/docs/tarfile-dataformat.adoc b/components/camel-tarfile/src/main/docs/tarfile-dataformat.adoc
index fba4bae..5b7dc9e 100644
--- a/components/camel-tarfile/src/main/docs/tarfile-dataformat.adoc
+++ b/components/camel-tarfile/src/main/docs/tarfile-dataformat.adoc
@@ -18,7 +18,7 @@ TarFile Options
 
 
 // dataformat options: START
-The Tar File dataformat supports 1 options which are listed below.
+The Tar File dataformat supports 2 options which are listed below.
 
 
 
@@ -27,6 +27,7 @@ The Tar File dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | usingIterator | false | Boolean | If the tar file has more then one entry the setting this option to true allows to work with the splitter EIP to split the data using an iterator in a streaming mode.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-univocity-parsers/src/main/docs/univocity-csv-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-univocity-parsers/src/main/docs/univocity-csv-dataformat.adoc b/components/camel-univocity-parsers/src/main/docs/univocity-csv-dataformat.adoc
index a482428..1e42224 100644
--- a/components/camel-univocity-parsers/src/main/docs/univocity-csv-dataformat.adoc
+++ b/components/camel-univocity-parsers/src/main/docs/univocity-csv-dataformat.adoc
@@ -49,7 +49,7 @@ Options
 
 
 // dataformat options: START
-The uniVocity CSV dataformat supports 17 options which are listed below.
+The uniVocity CSV dataformat supports 18 options which are listed below.
 
 
 
@@ -74,6 +74,7 @@ The uniVocity CSV dataformat supports 17 options which are listed below.
 | comment | # | String | The comment symbol. The default value is
 | lazyLoad | false | Boolean | Whether the unmarshalling should produce an iterator that reads the lines on the fly or if all the lines must be read at one. The default value is false
 | asMap | false | Boolean | Whether the unmarshalling should produce maps for the lines values instead of lists. It requires to have header (either defined or collected). The default value is false
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-univocity-parsers/src/main/docs/univocity-fixed-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-univocity-parsers/src/main/docs/univocity-fixed-dataformat.adoc b/components/camel-univocity-parsers/src/main/docs/univocity-fixed-dataformat.adoc
index 02229ab..813e541 100644
--- a/components/camel-univocity-parsers/src/main/docs/univocity-fixed-dataformat.adoc
+++ b/components/camel-univocity-parsers/src/main/docs/univocity-fixed-dataformat.adoc
@@ -49,7 +49,7 @@ Options
 
 
 // dataformat options: START
-The uniVocity Fixed Length dataformat supports 16 options which are listed below.
+The uniVocity Fixed Length dataformat supports 17 options which are listed below.
 
 
 
@@ -73,6 +73,7 @@ The uniVocity Fixed Length dataformat supports 16 options which are listed below
 | comment | # | String | The comment symbol. The default value is
 | lazyLoad | false | Boolean | Whether the unmarshalling should produce an iterator that reads the lines on the fly or if all the lines must be read at one. The default value is false
 | asMap | false | Boolean | Whether the unmarshalling should produce maps for the lines values instead of lists. It requires to have header (either defined or collected). The default value is false
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components/camel-univocity-parsers/src/main/docs/univocity-tsv-dataformat.adoc
----------------------------------------------------------------------
diff --git a/components/camel-univocity-parsers/src/main/docs/univocity-tsv-dataformat.adoc b/components/camel-univocity-parsers/src/main/docs/univocity-tsv-dataformat.adoc
index 30c0039..be2b39c 100644
--- a/components/camel-univocity-parsers/src/main/docs/univocity-tsv-dataformat.adoc
+++ b/components/camel-univocity-parsers/src/main/docs/univocity-tsv-dataformat.adoc
@@ -49,7 +49,7 @@ Options
 
 
 // dataformat options: START
-The uniVocity TSV dataformat supports 14 options which are listed below.
+The uniVocity TSV dataformat supports 15 options which are listed below.
 
 
 
@@ -71,6 +71,7 @@ The uniVocity TSV dataformat supports 14 options which are listed below.
 | comment | # | String | The comment symbol. The default value is
 | lazyLoad | false | Boolean | Whether the unmarshalling should produce an iterator that reads the lines on the fly or if all the lines must be read at one. The default value is false
 | asMap | false | Boolean | Whether the unmarshalling should produce maps for the lines values instead of lists. It requires to have header (either defined or collected). The default value is false
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END


[3/3] camel git commit: CAMEL-10633: Data formats marshal to xml/json now set content-type header by default.

Posted by da...@apache.org.
CAMEL-10633: Data formats marshal to xml/json now set content-type header by default.


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

Branch: refs/heads/master
Commit: 2815282561ed1ad5d0de4ddb70eb8ed288a2a667
Parents: af22f50
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Dec 23 15:48:51 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Dec 23 15:48:51 2016 +0100

----------------------------------------------------------------------
 camel-core/src/main/docs/gzip-dataformat.adoc   |  12 ++-
 .../src/main/docs/serialization-dataformat.adoc |  12 ++-
 camel-core/src/main/docs/string-dataformat.adoc |   3 +-
 camel-core/src/main/docs/zip-dataformat.adoc    |   3 +-
 .../camel/model/DataFormatDefinition.java       |  27 +++++
 .../springboot/AvroDataFormatConfiguration.java |  15 +++
 .../BarcodeDataFormatConfiguration.java         |  15 +++
 .../Base64DataFormatConfiguration.java          |  15 +++
 .../BeanIODataFormatConfiguration.java          |  15 +++
 .../BindyCsvDataFormatConfiguration.java        |  15 +++
 ...BindyFixedLengthDataFormatConfiguration.java |  15 +++
 ...indyKeyValuePairDataFormatConfiguration.java |  15 +++
 .../springboot/BoonDataFormatConfiguration.java |  15 +++
 .../CastorDataFormatConfiguration.java          |  15 +++
 .../springboot/GzipDataFormatConfiguration.java |  16 +++
 .../SerializationDataFormatConfiguration.java   |  16 +++
 .../StringDataFormatConfiguration.java          |  15 +++
 .../springboot/ZipDataFormatConfiguration.java  |  15 +++
 .../CryptoDataFormatConfiguration.java          |  15 +++
 .../springboot/PGPDataFormatConfiguration.java  |  15 +++
 .../springboot/CsvDataFormatConfiguration.java  |  15 +++
 .../FlatpackDataFormatConfiguration.java        |  15 +++
 .../springboot/GsonDataFormatConfiguration.java |  15 +++
 .../HessianDataFormatConfiguration.java         |  16 +++
 .../springboot/HL7DataFormatConfiguration.java  |  15 +++
 .../springboot/ICalDataFormatConfiguration.java |  15 +++
 .../JacksonDataFormatConfiguration.java         |  15 +++
 .../JacksonXMLDataFormatConfiguration.java      |  15 +++
 .../springboot/JaxbDataFormatConfiguration.java |  15 +++
 .../springboot/JibxDataFormatConfiguration.java |  15 +++
 .../JohnzonDataFormatConfiguration.java         |  15 +++
 .../springboot/LZFDataFormatConfiguration.java  |  15 +++
 .../MimeMultipartDataFormatConfiguration.java   |  15 +++
 .../ProtobufDataFormatConfiguration.java        |  15 +++
 .../springboot/RssDataFormatConfiguration.java  |  16 +++
 .../SnakeYAMLDataFormatConfiguration.java       |  15 +++
 .../SoapJaxbDataFormatConfiguration.java        |  15 +++
 .../SyslogDataFormatConfiguration.java          |  16 +++
 .../TidyMarkupDataFormatConfiguration.java      |  15 +++
 .../TarFileDataFormatConfiguration.java         |  15 +++
 .../UniVocityCsvDataFormatConfiguration.java    |  15 +++
 ...VocityFixedWidthDataFormatConfiguration.java |  15 +++
 .../UniVocityTsvDataFormatConfiguration.java    |  15 +++
 .../XmlBeansDataFormatConfiguration.java        |  15 +++
 .../XmlJsonDataFormatConfiguration.java         |  15 +++
 .../XmlRpcDataFormatConfiguration.java          |  15 +++
 .../XMLSecurityDataFormatConfiguration.java     |  15 +++
 .../springboot/JsonDataFormatConfiguration.java |  15 +++
 .../XStreamDataFormatConfiguration.java         |  15 +++
 .../ZipFileDataFormatConfiguration.java         |  15 +++
 .../src/main/docs/avro-dataformat.adoc          |   3 +-
 .../src/main/docs/barcode-dataformat.adoc       |   3 +-
 .../src/main/docs/base64-dataformat.adoc        |   3 +-
 .../src/main/docs/beanio-dataformat.adoc        |   3 +-
 .../src/main/docs/bindy-dataformat.adoc         |   3 +-
 .../src/main/docs/boon-dataformat.adoc          |   3 +-
 .../src/main/docs/castor-dataformat.adoc        |   3 +-
 .../castor/AbstractCastorDataFormat.java        |  21 ++++
 .../src/main/docs/crypto-dataformat.adoc        |   3 +-
 .../src/main/docs/pgp-dataformat.adoc           |   3 +-
 .../camel-csv/src/main/docs/csv-dataformat.adoc |   3 +-
 .../src/main/docs/flatpack-dataformat.adoc      |   3 +-
 .../src/main/docs/json-gson-dataformat.adoc     |   3 +-
 .../camel/component/gson/GsonDataFormat.java    |  21 ++++
 .../src/main/docs/hessian-dataformat.adoc       |  12 ++-
 .../camel-hl7/src/main/docs/hl7-dataformat.adoc |   3 +-
 .../src/main/docs/ical-dataformat.adoc          |   3 +-
 .../src/main/docs/json-jackson-dataformat.adoc  |   3 +-
 .../component/jackson/JacksonDataFormat.java    |  20 ++++
 .../JacksonMarshalContentTypeHeaderTest.java    | 100 +++++++++++++++++++
 .../src/main/docs/jacksonxml-dataformat.adoc    |   3 +-
 .../jacksonxml/JacksonXMLDataFormat.java        |  20 ++++
 .../JacksonMarshalContentTypeHeaderTest.java    |  99 ++++++++++++++++++
 .../src/main/docs/jaxb-dataformat.adoc          |   3 +-
 .../camel/converter/jaxb/JaxbDataFormat.java    |  20 ++++
 .../org/apache/camel/jaxb/CamelJaxbTest.java    |   3 +
 .../src/main/docs/jibx-dataformat.adoc          |   3 +-
 .../camel/dataformat/jibx/JibxDataFormat.java   |  23 ++++-
 .../src/main/docs/json-johnzon-dataformat.adoc  |   3 +-
 .../camel-lzf/src/main/docs/lzf-dataformat.adoc |   3 +-
 .../main/docs/mime-multipart-dataformat.adoc    |   3 +-
 .../src/main/docs/protobuf-dataformat.adoc      |   3 +-
 .../camel-rss/src/main/docs/rss-dataformat.adoc |  12 ++-
 .../main/docs/yaml-snakeyaml-dataformat.adoc    |   3 +-
 .../src/main/docs/soapjaxb-dataformat.adoc      |   3 +-
 .../src/main/docs/syslog-dataformat.adoc        |  12 ++-
 .../src/main/docs/tidyMarkup-dataformat.adoc    |   3 +-
 .../src/main/docs/tarfile-dataformat.adoc       |   3 +-
 .../src/main/docs/univocity-csv-dataformat.adoc |   3 +-
 .../main/docs/univocity-fixed-dataformat.adoc   |   3 +-
 .../src/main/docs/univocity-tsv-dataformat.adoc |   3 +-
 .../src/main/docs/xmlBeans-dataformat.adoc      |   3 +-
 .../converter/xmlbeans/XmlBeansConverter.java   |   3 -
 .../converter/xmlbeans/XmlBeansDataFormat.java  |  22 ++++
 .../src/main/docs/xmljson-dataformat.adoc       |   3 +-
 .../dataformat/xmljson/XmlJsonDataFormat.java   |  33 +++++-
 .../xmljson/XmlJsonDataFormatTest.java          |   3 +
 .../src/main/docs/xmlrpc-dataformat.adoc        |   3 +-
 .../src/main/docs/secureXML-dataformat.adoc     |   3 +-
 .../src/main/docs/json-xstream-dataformat.adoc  |   3 +-
 .../src/main/docs/xstream-dataformat.adoc       |   3 +-
 .../xstream/AbstractXStreamWrapper.java         |  14 +++
 .../dataformat/xstream/JsonDataFormat.java      |  13 +++
 .../dataformat/xstream/XStreamDataFormat.java   |  13 +++
 .../src/main/docs/zipfile-dataformat.adoc       |   3 +-
 105 files changed, 1261 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/camel-core/src/main/docs/gzip-dataformat.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/gzip-dataformat.adoc b/camel-core/src/main/docs/gzip-dataformat.adoc
index d93f1a4..d6c9196 100644
--- a/camel-core/src/main/docs/gzip-dataformat.adoc
+++ b/camel-core/src/main/docs/gzip-dataformat.adoc
@@ -17,7 +17,17 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The GZip dataformat has no options.
+The GZip dataformat supports 1 options which are listed below.
+
+
+
+{% raw %}
+[width="100%",cols="2s,1m,1m,6",options="header"]
+|=======================================================================
+| Name | Default | Java Type | Description
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
+|=======================================================================
+{% endraw %}
 // dataformat options: END
 
 [[GZipdataformat-Marshal]]

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/camel-core/src/main/docs/serialization-dataformat.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/serialization-dataformat.adoc b/camel-core/src/main/docs/serialization-dataformat.adoc
index 184326f..f15fa0f 100644
--- a/camel-core/src/main/docs/serialization-dataformat.adoc
+++ b/camel-core/src/main/docs/serialization-dataformat.adoc
@@ -20,7 +20,17 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The Java Object Serialization dataformat has no options.
+The Java Object Serialization dataformat supports 1 options which are listed below.
+
+
+
+{% raw %}
+[width="100%",cols="2s,1m,1m,6",options="header"]
+|=======================================================================
+| Name | Default | Java Type | Description
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
+|=======================================================================
+{% endraw %}
 // dataformat options: END
 
 [[Serialization-Dependencies]]

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/camel-core/src/main/docs/string-dataformat.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/string-dataformat.adoc b/camel-core/src/main/docs/string-dataformat.adoc
index 2ccf0c8..b531813 100644
--- a/camel-core/src/main/docs/string-dataformat.adoc
+++ b/camel-core/src/main/docs/string-dataformat.adoc
@@ -10,7 +10,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The String Encoding dataformat supports 1 options which are listed below.
+The String Encoding dataformat supports 2 options which are listed below.
 
 
 
@@ -19,6 +19,7 @@ The String Encoding dataformat supports 1 options which are listed below.
 |=======================================================================
 | Name | Default | Java Type | Description
 | charset |  | String | Sets an encoding to use. Will by default use the JVM platform default charset.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/camel-core/src/main/docs/zip-dataformat.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/zip-dataformat.adoc b/camel-core/src/main/docs/zip-dataformat.adoc
index f63bb2e..926a348 100644
--- a/camel-core/src/main/docs/zip-dataformat.adoc
+++ b/camel-core/src/main/docs/zip-dataformat.adoc
@@ -21,7 +21,7 @@ Options
 ^^^^^^^
 
 // dataformat options: START
-The Zip Deflate Compression dataformat supports 1 options which are listed below.
+The Zip Deflate Compression dataformat supports 2 options which are listed below.
 
 
 
@@ -30,6 +30,7 @@ The Zip Deflate Compression dataformat supports 1 options which are listed below
 |=======================================================================
 | Name | Default | Java Type | Description
 | compressionLevel | -1 | Integer | To specify a specific compression between 0-9. -1 is default compression 0 is no compression and 9 is best compression.
+| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |=======================================================================
 {% endraw %}
 // dataformat options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java b/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
index acf8223..06eeb19 100644
--- a/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
@@ -20,6 +20,7 @@ import java.util.Map;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.namespace.QName;
@@ -47,6 +48,8 @@ public class DataFormatDefinition extends IdentifiedType implements OtherAttribu
     // use xs:any to support optional property placeholders
     @XmlAnyAttribute
     private Map<QName, Object> otherAttributes;
+    @XmlAttribute
+    private Boolean contentTypeHeader;
 
     public DataFormatDefinition() {
     }
@@ -102,6 +105,15 @@ public class DataFormatDefinition extends IdentifiedType implements OtherAttribu
             try {
                 dataFormat = createDataFormat(routeContext);
                 if (dataFormat != null) {
+                    // is enabled by default so assume true if null
+                    if (contentTypeHeader == null || contentTypeHeader) {
+                        try {
+                            setProperty(routeContext.getCamelContext(), dataFormat, "contentTypeHeader", Boolean.TRUE);
+                        } catch (Exception e) {
+                            // ignore as this option is optional and not all data formats support this
+                        }
+                    }
+                    // configure the rest of the options
                     configureDataFormat(dataFormat, routeContext.getCamelContext());
                 } else {
                     throw new IllegalArgumentException(
@@ -194,6 +206,21 @@ public class DataFormatDefinition extends IdentifiedType implements OtherAttribu
         this.otherAttributes = otherAttributes;
     }
 
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    /**
+     * Whether the data format should set the <tt>Content-Type</tt> header with the type from the data format if the
+     * data format is capable of doing so.
+     * <p/>
+     * For example <tt>application/xml</tt> for data formats marshalling to XML, or <tt>application/json</tt>
+     * for data formats marshalling to JSon etc.
+     */
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
+
     public String getShortName() {
         String name = getClass().getSimpleName();
         if (name.endsWith("DataFormat")) {

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatConfiguration.java b/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatConfiguration.java
index 517051c..2f5a6a0 100644
--- a/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatConfiguration.java
+++ b/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatConfiguration.java
@@ -30,6 +30,13 @@ public class AvroDataFormatConfiguration {
      * Class name to use for marshal and unmarshalling
      */
     private String instanceClassName;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getInstanceClassName() {
         return instanceClassName;
@@ -38,4 +45,12 @@ public class AvroDataFormatConfiguration {
     public void setInstanceClassName(String instanceClassName) {
         this.instanceClassName = instanceClassName;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatConfiguration.java b/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatConfiguration.java
index 2d0f624..1cdb0c1 100644
--- a/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatConfiguration.java
+++ b/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatConfiguration.java
@@ -42,6 +42,13 @@ public class BarcodeDataFormatConfiguration {
      * Barcode format such as QR-Code
      */
     private String barcodeFormat;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Integer getWidth() {
         return width;
@@ -74,4 +81,12 @@ public class BarcodeDataFormatConfiguration {
     public void setBarcodeFormat(String barcodeFormat) {
         this.barcodeFormat = barcodeFormat;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java b/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java
index 2dccf9d..26bda5e 100644
--- a/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java
+++ b/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java
@@ -41,6 +41,13 @@ public class Base64DataFormatConfiguration {
      * modes. Is by default false.
      */
     private Boolean urlSafe = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Integer getLineLength() {
         return lineLength;
@@ -65,4 +72,12 @@ public class Base64DataFormatConfiguration {
     public void setUrlSafe(Boolean urlSafe) {
         this.urlSafe = urlSafe;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatConfiguration.java b/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatConfiguration.java
index 5c4b9ec..2f1922d 100644
--- a/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatConfiguration.java
+++ b/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatConfiguration.java
@@ -60,6 +60,13 @@ public class BeanIODataFormatConfiguration {
      * you use a custom error handler.
      */
     private String beanReaderErrorHandlerType;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getMapping() {
         return mapping;
@@ -116,4 +123,12 @@ public class BeanIODataFormatConfiguration {
     public void setBeanReaderErrorHandlerType(String beanReaderErrorHandlerType) {
         this.beanReaderErrorHandlerType = beanReaderErrorHandlerType;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java
index b249e17..0327be2 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java
@@ -41,6 +41,13 @@ public class BindyCsvDataFormatConfiguration {
      * the JVM platform default locale then use the name default
      */
     private String locale;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public BindyType getType() {
         return type;
@@ -65,4 +72,12 @@ public class BindyCsvDataFormatConfiguration {
     public void setLocale(String locale) {
         this.locale = locale;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java
index 8931068..d852707 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java
@@ -41,6 +41,13 @@ public class BindyFixedLengthDataFormatConfiguration {
      * the JVM platform default locale then use the name default
      */
     private String locale;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public BindyType getType() {
         return type;
@@ -65,4 +72,12 @@ public class BindyFixedLengthDataFormatConfiguration {
     public void setLocale(String locale) {
         this.locale = locale;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java
index b30ed96..e8d6b2b 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java
@@ -41,6 +41,13 @@ public class BindyKeyValuePairDataFormatConfiguration {
      * the JVM platform default locale then use the name default
      */
     private String locale;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public BindyType getType() {
         return type;
@@ -65,4 +72,12 @@ public class BindyKeyValuePairDataFormatConfiguration {
     public void setLocale(String locale) {
         this.locale = locale;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatConfiguration.java b/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatConfiguration.java
index 0763000..9832694 100644
--- a/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatConfiguration.java
+++ b/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatConfiguration.java
@@ -34,6 +34,13 @@ public class BoonDataFormatConfiguration {
      * To unarmshal to a List of Map or a List of Pojo.
      */
     private Boolean useList = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getUnmarshalTypeName() {
         return unmarshalTypeName;
@@ -50,4 +57,12 @@ public class BoonDataFormatConfiguration {
     public void setUseList(Boolean useList) {
         this.useList = useList;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java b/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java
index 8d7b69f..7f566af 100644
--- a/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java
+++ b/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java
@@ -46,6 +46,13 @@ public class CastorDataFormatConfiguration {
      * Add additional class names to Castor XmlContext
      */
     private String[] classes;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getMappingFile() {
         return mappingFile;
@@ -86,4 +93,12 @@ public class CastorDataFormatConfiguration {
     public void setClasses(String[] classes) {
         this.classes = classes;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java
index bcbd9cd..4953a5c 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java
@@ -25,4 +25,20 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
  */
 @ConfigurationProperties(prefix = "camel.dataformat.gzip")
 public class GzipDataFormatConfiguration {
+
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java
index d62fd2d..5cf28d4 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java
@@ -25,4 +25,20 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
  */
 @ConfigurationProperties(prefix = "camel.dataformat.serialization")
 public class SerializationDataFormatConfiguration {
+
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java
index c879cf8..aeccfac 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java
@@ -31,6 +31,13 @@ public class StringDataFormatConfiguration {
      * charset.
      */
     private String charset;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getCharset() {
         return charset;
@@ -39,4 +46,12 @@ public class StringDataFormatConfiguration {
     public void setCharset(String charset) {
         this.charset = charset;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java
index 8950916..401acb9 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java
@@ -31,6 +31,13 @@ public class ZipDataFormatConfiguration {
      * 0 is no compression and 9 is best compression.
      */
     private Integer compressionLevel = -1;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Integer getCompressionLevel() {
         return compressionLevel;
@@ -39,4 +46,12 @@ public class ZipDataFormatConfiguration {
     public void setCompressionLevel(Integer compressionLevel) {
         this.compressionLevel = compressionLevel;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConfiguration.java b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConfiguration.java
index 57c7e0e..867db4b 100644
--- a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConfiguration.java
+++ b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConfiguration.java
@@ -68,6 +68,13 @@ public class CryptoDataFormatConfiguration {
      * encrypted data stream. Is by default false.
      */
     private Boolean inline = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getAlgorithm() {
         return algorithm;
@@ -140,4 +147,12 @@ public class CryptoDataFormatConfiguration {
     public void setInline(Boolean inline) {
         this.inline = inline;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatConfiguration.java b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatConfiguration.java
index 63ce2b5..4e39f7f 100644
--- a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatConfiguration.java
+++ b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatConfiguration.java
@@ -119,6 +119,13 @@ public class PGPDataFormatConfiguration {
      * signature; otherwise an exception (PGPException) is thrown.
      */
     private String signatureVerificationOption;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getKeyUserid() {
         return keyUserid;
@@ -232,4 +239,12 @@ public class PGPDataFormatConfiguration {
             String signatureVerificationOption) {
         this.signatureVerificationOption = signatureVerificationOption;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatConfiguration.java b/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatConfiguration.java
index 705275f..e07831e 100644
--- a/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatConfiguration.java
+++ b/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatConfiguration.java
@@ -123,6 +123,13 @@ public class CsvDataFormatConfiguration {
      * Refers to a custom CsvRecordConverter to lookup from the registry to use.
      */
     private String recordConverterRef;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getFormatRef() {
         return formatRef;
@@ -307,4 +314,12 @@ public class CsvDataFormatConfiguration {
     public void setRecordConverterRef(String recordConverterRef) {
         this.recordConverterRef = recordConverterRef;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConfiguration.java b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConfiguration.java
index e31437b..4d81857 100644
--- a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConfiguration.java
+++ b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConfiguration.java
@@ -62,6 +62,13 @@ public class FlatpackDataFormatConfiguration {
      * characters.
      */
     private Boolean ignoreExtraColumns = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getParserFactoryRef() {
         return parserFactoryRef;
@@ -126,4 +133,12 @@ public class FlatpackDataFormatConfiguration {
     public void setIgnoreExtraColumns(Boolean ignoreExtraColumns) {
         this.ignoreExtraColumns = ignoreExtraColumns;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatConfiguration.java b/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatConfiguration.java
index 4e89e3f..ed36e44 100644
--- a/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatConfiguration.java
+++ b/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatConfiguration.java
@@ -128,6 +128,13 @@ public class GsonDataFormatConfiguration {
      * only be enabled when desired to be used.
      */
     private Boolean allowUnmarshallType = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getObjectMapper() {
         return objectMapper;
@@ -256,4 +263,12 @@ public class GsonDataFormatConfiguration {
     public void setAllowUnmarshallType(Boolean allowUnmarshallType) {
         this.allowUnmarshallType = allowUnmarshallType;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatConfiguration.java b/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatConfiguration.java
index 4a24215..b00d46d 100644
--- a/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatConfiguration.java
+++ b/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatConfiguration.java
@@ -25,4 +25,20 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
  */
 @ConfigurationProperties(prefix = "camel.dataformat.hessian")
 public class HessianDataFormatConfiguration {
+
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConfiguration.java b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConfiguration.java
index b2ac0fb..f25f772 100644
--- a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConfiguration.java
+++ b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConfiguration.java
@@ -30,6 +30,13 @@ public class HL7DataFormatConfiguration {
      * Whether to validate the HL7 message Is by default true.
      */
     private Boolean validate = true;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getValidate() {
         return validate;
@@ -38,4 +45,12 @@ public class HL7DataFormatConfiguration {
     public void setValidate(Boolean validate) {
         this.validate = validate;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatConfiguration.java b/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatConfiguration.java
index bc38d28..88ddfa0 100644
--- a/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatConfiguration.java
+++ b/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatConfiguration.java
@@ -30,6 +30,13 @@ public class ICalDataFormatConfiguration {
      * Whether to validate.
      */
     private Boolean validating = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getValidating() {
         return validating;
@@ -38,4 +45,12 @@ public class ICalDataFormatConfiguration {
     public void setValidating(Boolean validating) {
         this.validating = validating;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConfiguration.java b/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConfiguration.java
index e00a318..862eb38 100644
--- a/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConfiguration.java
+++ b/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConfiguration.java
@@ -128,6 +128,13 @@ public class JacksonDataFormatConfiguration {
      * only be enabled when desired to be used.
      */
     private Boolean allowUnmarshallType = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getObjectMapper() {
         return objectMapper;
@@ -256,4 +263,12 @@ public class JacksonDataFormatConfiguration {
     public void setAllowUnmarshallType(Boolean allowUnmarshallType) {
         this.allowUnmarshallType = allowUnmarshallType;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatConfiguration.java b/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatConfiguration.java
index 75734c0..50c8062 100644
--- a/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatConfiguration.java
+++ b/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatConfiguration.java
@@ -107,6 +107,13 @@ public class JacksonXMLDataFormatConfiguration {
      * only be enabled when desired to be used.
      */
     private Boolean allowUnmarshallType = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getXmlMapper() {
         return xmlMapper;
@@ -219,4 +226,12 @@ public class JacksonXMLDataFormatConfiguration {
     public void setAllowUnmarshallType(Boolean allowUnmarshallType) {
         this.allowUnmarshallType = allowUnmarshallType;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatConfiguration.java b/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatConfiguration.java
index 267bc12..a980537 100644
--- a/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatConfiguration.java
+++ b/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatConfiguration.java
@@ -109,6 +109,13 @@ public class JaxbDataFormatConfiguration {
      * custom JAXB provider properties to be used with the JAXB marshaller.
      */
     private String jaxbProviderProperties;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getContextPath() {
         return contextPath;
@@ -237,4 +244,12 @@ public class JaxbDataFormatConfiguration {
     public void setJaxbProviderProperties(String jaxbProviderProperties) {
         this.jaxbProviderProperties = jaxbProviderProperties;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatConfiguration.java b/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatConfiguration.java
index 3f0742f..47af923 100644
--- a/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatConfiguration.java
+++ b/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatConfiguration.java
@@ -34,6 +34,13 @@ public class JibxDataFormatConfiguration {
      * To use a custom binding factory
      */
     private String bindingName;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getUnmarshallClass() {
         return unmarshallClass;
@@ -50,4 +57,12 @@ public class JibxDataFormatConfiguration {
     public void setBindingName(String bindingName) {
         this.bindingName = bindingName;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatConfiguration.java b/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatConfiguration.java
index d6c73df..a12c22e 100644
--- a/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatConfiguration.java
+++ b/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatConfiguration.java
@@ -128,6 +128,13 @@ public class JohnzonDataFormatConfiguration {
      * only be enabled when desired to be used.
      */
     private Boolean allowUnmarshallType = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getObjectMapper() {
         return objectMapper;
@@ -256,4 +263,12 @@ public class JohnzonDataFormatConfiguration {
     public void setAllowUnmarshallType(Boolean allowUnmarshallType) {
         this.allowUnmarshallType = allowUnmarshallType;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatConfiguration.java b/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatConfiguration.java
index 14eb87b..9a716b6 100644
--- a/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatConfiguration.java
+++ b/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatConfiguration.java
@@ -30,6 +30,13 @@ public class LZFDataFormatConfiguration {
      * Enable encoding (compress) using multiple processing cores.
      */
     private Boolean usingParallelCompression = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getUsingParallelCompression() {
         return usingParallelCompression;
@@ -38,4 +45,12 @@ public class LZFDataFormatConfiguration {
     public void setUsingParallelCompression(Boolean usingParallelCompression) {
         this.usingParallelCompression = usingParallelCompression;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatConfiguration.java b/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatConfiguration.java
index a881a5d..9c2202a 100644
--- a/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatConfiguration.java
+++ b/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatConfiguration.java
@@ -51,6 +51,13 @@ public class MimeMultipartDataFormatConfiguration {
      * binary (true) or Base-64 encoded (false) Default is false.
      */
     private Boolean binaryContent = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getMultipartSubType() {
         return multipartSubType;
@@ -91,4 +98,12 @@ public class MimeMultipartDataFormatConfiguration {
     public void setBinaryContent(Boolean binaryContent) {
         this.binaryContent = binaryContent;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatConfiguration.java b/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatConfiguration.java
index f00ae59..02fbd99 100644
--- a/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatConfiguration.java
+++ b/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatConfiguration.java
@@ -30,6 +30,13 @@ public class ProtobufDataFormatConfiguration {
      * Name of class to use when unarmshalling
      */
     private String instanceClass;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getInstanceClass() {
         return instanceClass;
@@ -38,4 +45,12 @@ public class ProtobufDataFormatConfiguration {
     public void setInstanceClass(String instanceClass) {
         this.instanceClass = instanceClass;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatConfiguration.java b/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatConfiguration.java
index 2616eba..405e8af 100644
--- a/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatConfiguration.java
+++ b/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatConfiguration.java
@@ -25,4 +25,20 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
  */
 @ConfigurationProperties(prefix = "camel.dataformat.rss")
 public class RssDataFormatConfiguration {
+
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java b/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java
index 588a5da..0bd61ab 100644
--- a/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java
+++ b/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java
@@ -71,6 +71,13 @@ public class SnakeYAMLDataFormatConfiguration {
      * Set the types SnakeYAML is allowed to un-marshall
      */
     private List<YAMLTypeFilterDefinition> typeFilter;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public YAMLLibrary getLibrary() {
         return library;
@@ -152,4 +159,12 @@ public class SnakeYAMLDataFormatConfiguration {
     public void setTypeFilter(List<YAMLTypeFilterDefinition> typeFilter) {
         this.typeFilter = typeFilter;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatConfiguration.java b/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatConfiguration.java
index 4acfcf1..311d951 100644
--- a/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatConfiguration.java
+++ b/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatConfiguration.java
@@ -71,6 +71,13 @@ public class SoapJaxbDataFormatConfiguration {
      * You can separate multiple schema files by using the '' character.
      */
     private String schema;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getContextPath() {
         return contextPath;
@@ -119,4 +126,12 @@ public class SoapJaxbDataFormatConfiguration {
     public void setSchema(String schema) {
         this.schema = schema;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-syslog-starter/src/main/java/org/apache/camel/component/syslog/springboot/SyslogDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-syslog-starter/src/main/java/org/apache/camel/component/syslog/springboot/SyslogDataFormatConfiguration.java b/components-starter/camel-syslog-starter/src/main/java/org/apache/camel/component/syslog/springboot/SyslogDataFormatConfiguration.java
index 12dec5f..afdc18f 100644
--- a/components-starter/camel-syslog-starter/src/main/java/org/apache/camel/component/syslog/springboot/SyslogDataFormatConfiguration.java
+++ b/components-starter/camel-syslog-starter/src/main/java/org/apache/camel/component/syslog/springboot/SyslogDataFormatConfiguration.java
@@ -25,4 +25,20 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
  */
 @ConfigurationProperties(prefix = "camel.dataformat.syslog")
 public class SyslogDataFormatConfiguration {
+
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-tagsoup-starter/src/main/java/org/apache/camel/dataformat/tagsoup/springboot/TidyMarkupDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-tagsoup-starter/src/main/java/org/apache/camel/dataformat/tagsoup/springboot/TidyMarkupDataFormatConfiguration.java b/components-starter/camel-tagsoup-starter/src/main/java/org/apache/camel/dataformat/tagsoup/springboot/TidyMarkupDataFormatConfiguration.java
index 40b4da7..0e45ec6 100644
--- a/components-starter/camel-tagsoup-starter/src/main/java/org/apache/camel/dataformat/tagsoup/springboot/TidyMarkupDataFormatConfiguration.java
+++ b/components-starter/camel-tagsoup-starter/src/main/java/org/apache/camel/dataformat/tagsoup/springboot/TidyMarkupDataFormatConfiguration.java
@@ -35,6 +35,13 @@ public class TidyMarkupDataFormatConfiguration {
      * When returning a String do we omit the XML declaration in the top.
      */
     private Boolean omitXmlDeclaration = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getDataObjectType() {
         return dataObjectType;
@@ -51,4 +58,12 @@ public class TidyMarkupDataFormatConfiguration {
     public void setOmitXmlDeclaration(Boolean omitXmlDeclaration) {
         this.omitXmlDeclaration = omitXmlDeclaration;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-tarfile-starter/src/main/java/org/apache/camel/dataformat/tarfile/springboot/TarFileDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-tarfile-starter/src/main/java/org/apache/camel/dataformat/tarfile/springboot/TarFileDataFormatConfiguration.java b/components-starter/camel-tarfile-starter/src/main/java/org/apache/camel/dataformat/tarfile/springboot/TarFileDataFormatConfiguration.java
index 3b87904..87cbeb0 100644
--- a/components-starter/camel-tarfile-starter/src/main/java/org/apache/camel/dataformat/tarfile/springboot/TarFileDataFormatConfiguration.java
+++ b/components-starter/camel-tarfile-starter/src/main/java/org/apache/camel/dataformat/tarfile/springboot/TarFileDataFormatConfiguration.java
@@ -32,6 +32,13 @@ public class TarFileDataFormatConfiguration {
      * in a streaming mode.
      */
     private Boolean usingIterator = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getUsingIterator() {
         return usingIterator;
@@ -40,4 +47,12 @@ public class TarFileDataFormatConfiguration {
     public void setUsingIterator(Boolean usingIterator) {
         this.usingIterator = usingIterator;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityCsvDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityCsvDataFormatConfiguration.java b/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityCsvDataFormatConfiguration.java
index 8d5545d..6b4bb84 100644
--- a/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityCsvDataFormatConfiguration.java
+++ b/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityCsvDataFormatConfiguration.java
@@ -104,6 +104,13 @@ public class UniVocityCsvDataFormatConfiguration {
      * collected). The default value is false
      */
     private Boolean asMap = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getQuoteAllFields() {
         return quoteAllFields;
@@ -240,4 +247,12 @@ public class UniVocityCsvDataFormatConfiguration {
     public void setAsMap(Boolean asMap) {
         this.asMap = asMap;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityFixedWidthDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityFixedWidthDataFormatConfiguration.java b/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityFixedWidthDataFormatConfiguration.java
index 14ac124..6fada79 100644
--- a/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityFixedWidthDataFormatConfiguration.java
+++ b/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityFixedWidthDataFormatConfiguration.java
@@ -101,6 +101,13 @@ public class UniVocityFixedWidthDataFormatConfiguration {
      * collected). The default value is false
      */
     private Boolean asMap = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getSkipTrailingCharsUntilNewline() {
         return skipTrailingCharsUntilNewline;
@@ -230,4 +237,12 @@ public class UniVocityFixedWidthDataFormatConfiguration {
     public void setAsMap(Boolean asMap) {
         this.asMap = asMap;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityTsvDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityTsvDataFormatConfiguration.java b/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityTsvDataFormatConfiguration.java
index 7c9a66b..110369f 100644
--- a/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityTsvDataFormatConfiguration.java
+++ b/components-starter/camel-univocity-parsers-starter/src/main/java/org/apache/camel/dataformat/univocity/springboot/UniVocityTsvDataFormatConfiguration.java
@@ -92,6 +92,13 @@ public class UniVocityTsvDataFormatConfiguration {
      * collected). The default value is false
      */
     private Boolean asMap = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public String getEscapeChar() {
         return escapeChar;
@@ -204,4 +211,12 @@ public class UniVocityTsvDataFormatConfiguration {
     public void setAsMap(Boolean asMap) {
         this.asMap = asMap;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28152825/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatConfiguration.java b/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatConfiguration.java
index 5aed017..eef7b64 100644
--- a/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatConfiguration.java
+++ b/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatConfiguration.java
@@ -30,6 +30,13 @@ public class XmlBeansDataFormatConfiguration {
      * To enable pretty printing output nicely formatted. Is by default false.
      */
     private Boolean prettyPrint = false;
+    /**
+     * Whether the data format should set the Content-Type header with the type
+     * from the data format if the data format is capable of doing so. For
+     * example application/xml for data formats marshalling to XML or
+     * application/json for data formats marshalling to JSon etc.
+     */
+    private Boolean contentTypeHeader = false;
 
     public Boolean getPrettyPrint() {
         return prettyPrint;
@@ -38,4 +45,12 @@ public class XmlBeansDataFormatConfiguration {
     public void setPrettyPrint(Boolean prettyPrint) {
         this.prettyPrint = prettyPrint;
     }
+
+    public Boolean getContentTypeHeader() {
+        return contentTypeHeader;
+    }
+
+    public void setContentTypeHeader(Boolean contentTypeHeader) {
+        this.contentTypeHeader = contentTypeHeader;
+    }
 }
\ No newline at end of file