[camel] branch sandbox/camel-3.x updated (541d6b6 -> c5778f5)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch sandbox/camel-3.x updated (541d6b6 -> c5778f5)

acosentino
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 541d6b6  CAMEL-12759 - Misleading documentation for Netty components - Netty4-http
     new 1de3898  CAMEL-12631 - SFTP: Socket timeout overwrites Server Alive Interval
     new d3bf30b  CAMEL-12631 - Fixed CS
     new 3dc94b5  Upgrade TestContainers to version 1.10.1
     new c5778f5  UPDATED RestBindingAdvice

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/processor/RestBindingAdvice.java  |  12 +++
 .../component/file/remote/SftpOperations.java      | 118 ++++++++++++---------
 parent/pom.xml                                     |   2 +-
 3 files changed, 82 insertions(+), 50 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[camel] 01/04: CAMEL-12631 - SFTP: Socket timeout overwrites Server Alive Interval

acosentino
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1de38985ae04ee2e3b6ff93ab3b98a5d3a9df706
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Fri Nov 16 13:30:25 2018 +0100

    CAMEL-12631 - SFTP: Socket timeout overwrites Server Alive Interval
---
 .../org/apache/camel/component/file/remote/SftpOperations.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
index c09d633..a7fbaaf 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
@@ -354,8 +354,12 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
         });
 
         // set the SO_TIMEOUT for the time after the connect phase
-        if (configuration.getSoTimeout() > 0) {
-            session.setTimeout(configuration.getSoTimeout());
+        if (sftpConfig.getServerAliveInterval() == 0) {
+            if (configuration.getSoTimeout() > 0) {
+               session.setTimeout(configuration.getSoTimeout());
+            }
+        } else {
+         LOG.debug("The Server Alive Internal is already set, the socket timeout won't be considered to avoid overidding the provided Server alive interval value");
         }
 
         // set proxy if configured

Reply | Threaded
Open this post in threaded view
|

[camel] 02/04: CAMEL-12631 - Fixed CS

acosentino
In reply to this post by acosentino
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d3bf30be514fec749943b47414cf3b1de578b776
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Fri Nov 16 13:47:02 2018 +0100

    CAMEL-12631 - Fixed CS
---
 .../component/file/remote/SftpOperations.java      | 114 ++++++++++++---------
 1 file changed, 65 insertions(+), 49 deletions(-)

diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
index a7fbaaf..1ecce01 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
@@ -47,6 +47,7 @@ import com.jcraft.jsch.SftpException;
 import com.jcraft.jsch.SocketFactory;
 import com.jcraft.jsch.UIKeyboardInteractive;
 import com.jcraft.jsch.UserInfo;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.LoggingLevel;
@@ -70,7 +71,8 @@ import static org.apache.camel.util.ObjectHelper.isNotEmpty;
 /**
  * SFTP remote file operations
  * <p/>
- * The JSCH session and channel are not thread-safe so we need to synchronize access to using this operation.
+ * The JSCH session and channel are not thread-safe so we need to synchronize
+ * access to using this operation.
  */
 public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
     private static final Logger LOG = LoggerFactory.getLogger(SftpOperations.class);
@@ -88,13 +90,14 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
     }
 
     /**
-     * Extended user info which supports interactive keyboard mode, by entering the password.
+     * Extended user info which supports interactive keyboard mode, by entering
+     * the password.
      */
     public interface ExtendedUserInfo extends UserInfo, UIKeyboardInteractive {
     }
 
     public void setEndpoint(GenericFileEndpoint<SftpRemoteFile> endpoint) {
-        this.endpoint = (SftpEndpoint) endpoint;
+        this.endpoint = (SftpEndpoint)endpoint;
     }
 
     public synchronized boolean connect(RemoteFileConfiguration configuration) throws GenericFileOperationFailedException {
@@ -126,7 +129,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                     }
 
                     LOG.trace("Channel isn't connected, trying to recreate and connect.");
-                    channel = (ChannelSftp) session.openChannel("sftp");
+                    channel = (ChannelSftp)session.openChannel("sftp");
 
                     if (endpoint.getConfiguration().getConnectTimeout() > 0) {
                         LOG.trace("Connecting use connectTimeout: {} ...", endpoint.getConfiguration().getConnectTimeout());
@@ -191,7 +194,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
         final JSch jsch = new JSch();
         JSch.setLogger(new JSchLogger(endpoint.getConfiguration().getJschLoggingLevel()));
 
-        SftpConfiguration sftpConfig = (SftpConfiguration) configuration;
+        SftpConfiguration sftpConfig = (SftpConfiguration)configuration;
 
         if (isNotEmpty(sftpConfig.getCiphers())) {
             LOG.debug("Using ciphers: {}", sftpConfig.getCiphers());
@@ -333,7 +336,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
 
             public boolean promptYesNo(String s) {
                 LOG.warn("Server asks for confirmation (yes|no): {}. Camel will answer no.", s);
-                // Return 'false' indicating modification of the hosts file is disabled.
+                // Return 'false' indicating modification of the hosts file is
+                // disabled.
                 return false;
             }
 
@@ -341,13 +345,12 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                 LOG.trace("Message received from Server: {}", s);
             }
 
-            public String[] promptKeyboardInteractive(String destination, String name,
-                                                      String instruction, String[] prompt, boolean[] echo) {
+            public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) {
                 // must return an empty array if password is null
                 if (configuration.getPassword() == null) {
                     return new String[0];
                 } else {
-                    return new String[]{configuration.getPassword()};
+                    return new String[] {configuration.getPassword()};
                 }
             }
 
@@ -356,10 +359,10 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
         // set the SO_TIMEOUT for the time after the connect phase
         if (sftpConfig.getServerAliveInterval() == 0) {
             if (configuration.getSoTimeout() > 0) {
-               session.setTimeout(configuration.getSoTimeout());
+                session.setTimeout(configuration.getSoTimeout());
             }
         } else {
-         LOG.debug("The Server Alive Internal is already set, the socket timeout won't be considered to avoid overidding the provided Server alive interval value");
+            LOG.debug("The Server Alive Internal is already set, the socket timeout won't be considered to avoid overidding the provided Server alive interval value");
         }
 
         // set proxy if configured
@@ -486,7 +489,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
         LOG.debug("Renaming file: {} to: {}", from, to);
         try {
             reconnectIfNecessary();
-            //make use of the '/' separator because JSch expects this
+            // make use of the '/' separator because JSch expects this
             // as the file separator even on Windows
             to = FileUtil.compactPath(to, '/');
             channel.rename(from, to);
@@ -511,7 +514,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                 channel.ls(directory);
                 success = true;
             } catch (SftpException e) {
-                // ignore, we could not change directory so try to create it instead
+                // ignore, we could not change directory so try to create it
+                // instead
             }
 
             if (!success) {
@@ -521,7 +525,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                     channel.mkdir(directory);
                     success = true;
                 } catch (SftpException e) {
-                    // we are here if the server side doesn't create intermediate folders
+                    // we are here if the server side doesn't create
+                    // intermediate folders
                     // so create the folder one by one
                     success = buildDirectoryChunks(directory);
                 }
@@ -582,8 +587,10 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             return;
         }
 
-        // must compact path so SFTP server can traverse correctly, make use of the '/'
-        // separator because JSch expects this as the file separator even on Windows
+        // must compact path so SFTP server can traverse correctly, make use of
+        // the '/'
+        // separator because JSch expects this as the file separator even on
+        // Windows
         String before = path;
         char separatorChar = '/';
         path = FileUtil.compactPath(path, separatorChar);
@@ -597,8 +604,9 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             return;
         }
         if (getCurrentDirectory().startsWith(path)) {
-            // extract the path segment relative to the target path and make sure it keeps the preceding '/' for the regex op
-            String p = getCurrentDirectory().substring(path.length() - (path.endsWith("/") ?  1 : 0));
+            // extract the path segment relative to the target path and make
+            // sure it keeps the preceding '/' for the regex op
+            String p = getCurrentDirectory().substring(path.length() - (path.endsWith("/") ? 1 : 0));
             if (p.length() == 0) {
                 return;
             }
@@ -606,7 +614,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             path = UP_DIR_PATTERN.matcher(p).replaceAll("/..").substring(1);
         }
 
-        // if it starts with the root path then a little special handling for that
+        // if it starts with the root path then a little special handling for
+        // that
         if (FileUtil.hasLeadingSeparator(path)) {
             // change to root path
             if (!FileUtil.isWindows()) {
@@ -677,7 +686,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             // can return either null or an empty list depending on FTP servers
             if (files != null) {
                 for (Object file : files) {
-                    list.add(new SftpRemoteFileJCraft((ChannelSftp.LsEntry) file));
+                    list.add(new SftpRemoteFileJCraft((ChannelSftp.LsEntry)file));
                 }
             }
             return list;
@@ -689,7 +698,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
     public synchronized boolean retrieveFile(String name, Exchange exchange, long size) throws GenericFileOperationFailedException {
         LOG.trace("retrieveFile({})", name);
         if (ObjectHelper.isNotEmpty(endpoint.getLocalWorkDirectory())) {
-            // local work directory is configured so we should store file content as files in this local directory
+            // local work directory is configured so we should store file
+            // content as files in this local directory
             return retrieveFileToFileInLocalWorkDirectory(name, exchange);
         } else {
             // store file content directory as stream on the body
@@ -713,8 +723,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
     private boolean retrieveFileToStreamInBody(String name, Exchange exchange) throws GenericFileOperationFailedException {
         String currentDir = null;
         try {
-            GenericFile<ChannelSftp.LsEntry> target =
-                    (GenericFile<ChannelSftp.LsEntry>) exchange.getProperty(FileComponent.FILE_EXCHANGE_FILE);
+            GenericFile<ChannelSftp.LsEntry> target = (GenericFile<ChannelSftp.LsEntry>)exchange.getProperty(FileComponent.FILE_EXCHANGE_FILE);
             ObjectHelper.notNull(target, "Exchange should have the " + FileComponent.FILE_EXCHANGE_FILE + " set");
 
             String remoteName = name;
@@ -723,12 +732,14 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                 currentDir = getCurrentDirectory();
 
                 // change directory to path where the file is to be retrieved
-                // (must do this as some FTP servers cannot retrieve using absolute path)
+                // (must do this as some FTP servers cannot retrieve using
+                // absolute path)
                 String path = FileUtil.onlyPath(name);
                 if (path != null) {
                     changeCurrentDirectory(path);
                 }
-                // remote name is now only the file name as we just changed directory
+                // remote name is now only the file name as we just changed
+                // directory
                 remoteName = FileUtil.stripPath(name);
             }
 
@@ -764,8 +775,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
         File temp;
         File local = new File(endpoint.getLocalWorkDirectory());
         OutputStream os;
-        GenericFile<ChannelSftp.LsEntry> file =
-                (GenericFile<ChannelSftp.LsEntry>) exchange.getProperty(FileComponent.FILE_EXCHANGE_FILE);
+        GenericFile<ChannelSftp.LsEntry> file = (GenericFile<ChannelSftp.LsEntry>)exchange.getProperty(FileComponent.FILE_EXCHANGE_FILE);
         ObjectHelper.notNull(file, "Exchange should have the " + FileComponent.FILE_EXCHANGE_FILE + " set");
         try {
             // use relative filename in local work directory
@@ -794,7 +804,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                 throw new GenericFileOperationFailedException("Cannot create new local work file: " + temp);
             }
 
-            // store content as a file in the local work directory in the temp handle
+            // store content as a file in the local work directory in the temp
+            // handle
             os = new FileOutputStream(temp);
 
             // set header with the path to the local work file
@@ -813,12 +824,14 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                 currentDir = getCurrentDirectory();
 
                 // change directory to path where the file is to be retrieved
-                // (must do this as some FTP servers cannot retrieve using absolute path)
+                // (must do this as some FTP servers cannot retrieve using
+                // absolute path)
                 String path = FileUtil.onlyPath(name);
                 if (path != null) {
                     changeCurrentDirectory(path);
                 }
-                // remote name is now only the file name as we just changed directory
+                // remote name is now only the file name as we just changed
+                // directory
                 remoteName = FileUtil.stripPath(name);
             }
 
@@ -826,7 +839,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
 
         } catch (SftpException e) {
             LOG.trace("Error occurred during retrieving file: {} to local directory. Deleting local work file: {}", name, temp);
-            // failed to retrieve the file so we need to close streams and delete in progress file
+            // failed to retrieve the file so we need to close streams and
+            // delete in progress file
             // must close stream before deleting file
             IOHelper.close(os, "retrieve: " + name, LOG);
             boolean deleted = FileUtil.deleteFile(temp);
@@ -845,7 +859,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
 
         LOG.debug("Retrieve file to local work file result: true");
 
-        // operation went okay so rename temp to local after we have retrieved the data
+        // operation went okay so rename temp to local after we have retrieved
+        // the data
         LOG.trace("Renaming local in progress file from: {} to: {}", temp, local);
         try {
             if (!FileUtil.renameFile(temp, local, false)) {
@@ -871,13 +886,15 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
 
         try {
             if (path != null && endpoint.getConfiguration().isStepwise()) {
-                // must remember current dir so we stay in that directory after the write
+                // must remember current dir so we stay in that directory after
+                // the write
                 currentDir = getCurrentDirectory();
 
                 // change to path of name
                 changeCurrentDirectory(path);
 
-                // the target name should be without path, as we have changed directory
+                // the target name should be without path, as we have changed
+                // directory
                 targetName = FileUtil.stripPath(name);
             }
 
@@ -897,9 +914,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
         LOG.trace("doStoreFile({})", targetName);
 
         // if an existing file already exists what should we do?
-        if (endpoint.getFileExist() == GenericFileExist.Ignore
-                || endpoint.getFileExist() == GenericFileExist.Fail
-                || endpoint.getFileExist() == GenericFileExist.Move) {
+        if (endpoint.getFileExist() == GenericFileExist.Ignore || endpoint.getFileExist() == GenericFileExist.Fail || endpoint.getFileExist() == GenericFileExist.Move) {
             boolean existFile = existsFile(targetName);
             if (existFile && endpoint.getFileExist() == GenericFileExist.Ignore) {
                 // ignore but indicate that the file was written
@@ -918,7 +933,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             // Do an explicit test for a null body and decide what to do
             if (endpoint.isAllowNullBody()) {
                 LOG.trace("Writing empty file.");
-                is = new ByteArrayInputStream(new byte[]{});
+                is = new ByteArrayInputStream(new byte[] {});
             } else {
                 throw new GenericFileOperationFailedException("Cannot write null body to file: " + name);
             }
@@ -949,8 +964,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             }
             if (LOG.isDebugEnabled()) {
                 long time = watch.taken();
-                LOG.debug("Took {} ({} millis) to store file: {} and FTP client returned: true",
-                        new Object[]{TimeUtils.printDuration(time), time, targetName});
+                LOG.debug("Took {} ({} millis) to store file: {} and FTP client returned: true", new Object[] {TimeUtils.printDuration(time), time, targetName});
             }
 
             // after storing file, we may set chmod on the file
@@ -974,7 +988,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             IOHelper.close(is, "store: " + name, LOG);
         }
     }
-    
+
     public synchronized boolean existsFile(String name) throws GenericFileOperationFailedException {
         LOG.trace("existsFile({})", name);
         if (endpoint.isFastExistsCheck()) {
@@ -996,7 +1010,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                 return false;
             }
             for (Object file : files) {
-                ChannelSftp.LsEntry entry = (ChannelSftp.LsEntry) file;
+                ChannelSftp.LsEntry entry = (ChannelSftp.LsEntry)file;
                 String existing = entry.getFilename();
                 LOG.trace("Existing file: {}, target file: {}", existing, name);
                 existing = FileUtil.stripPath(existing);
@@ -1006,7 +1020,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             }
             return false;
         } catch (SftpException e) {
-            // or an exception can be thrown with id 2 which means file does not exists
+            // or an exception can be thrown with id 2 which means file does not
+            // exists
             if (ChannelSftp.SSH_FX_NO_SUCH_FILE == e.id) {
                 return false;
             }
@@ -1025,7 +1040,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
             }
             return files.size() >= 1;
         } catch (SftpException e) {
-            // or an exception can be thrown with id 2 which means file does not exists
+            // or an exception can be thrown with id 2 which means file does not
+            // exists
             if (ChannelSftp.SSH_FX_NO_SUCH_FILE == e.id) {
                 return false;
             }
@@ -1054,10 +1070,9 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
     }
 
     /*
-     * adapted from com.jcraft.jsch.Util.createSocket(String, int, int)
-     *
-     * added possibility to specify the address of the local network interface, against the
-     * connection should bind
+     * adapted from com.jcraft.jsch.Util.createSocket(String, int, int) added
+     * possibility to specify the address of the local network interface,
+     * against the connection should bind
      */
     static Socket createSocketUtil(final String host, final int port, final String bindAddress, final int timeout) {
         Socket socket = null;
@@ -1086,7 +1101,8 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
                     if (sockp[0] != null && sockp[0].isConnected()) {
                         try {
                             sockp[0].close();
-                        } catch (Exception eee) { }
+                        } catch (Exception eee) {
+                        }
                     }
                     sockp[0] = null;
                 }

Reply | Threaded
Open this post in threaded view
|

[camel] 03/04: Upgrade TestContainers to version 1.10.1

acosentino
In reply to this post by acosentino
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 3dc94b51f73d376740f205e3232071365c9605e6
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Fri Nov 16 15:18:59 2018 +0100

    Upgrade TestContainers to version 1.10.1
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 7976913..d59a042 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -679,7 +679,7 @@
     <stringtemplate-version>4.0.8</stringtemplate-version>
     <tagsoup-bundle-version>1.2.1_1</tagsoup-bundle-version>
     <tagsoup-version>1.2.1</tagsoup-version>
-    <testcontainers-version>1.10.0</testcontainers-version>
+    <testcontainers-version>1.10.1</testcontainers-version>
     <testng-version>6.14.2</testng-version>
     <tinybundles-version>2.1.1</tinybundles-version>
     <tika-version>1.19.1</tika-version>

Reply | Threaded
Open this post in threaded view
|

[camel] 04/04: UPDATED RestBindingAdvice

acosentino
In reply to this post by acosentino
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c5778f5cc01f47c2f521ae26328c8f4b6c333c00
Author: Robert Gru╠łndler <[hidden email]>
AuthorDate: Fri Nov 16 15:02:34 2018 +0100

    UPDATED RestBindingAdvice
   
    - Support for the catchAll */* MimeType
    - Added some logs to ease debugging when clientRequestValidation is
    turned on
---
 .../java/org/apache/camel/processor/RestBindingAdvice.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/camel-core/src/main/java/org/apache/camel/processor/RestBindingAdvice.java b/camel-core/src/main/java/org/apache/camel/processor/RestBindingAdvice.java
index 95ddb3d..3d09b08 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/RestBindingAdvice.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/RestBindingAdvice.java
@@ -34,6 +34,8 @@ import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.support.ExchangeHelper;
 import org.apache.camel.support.MessageHelper;
 import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A {@link CamelInternalProcessorAdvice} that binds the REST DSL incoming
@@ -47,6 +49,8 @@ import org.apache.camel.util.ObjectHelper;
  * @see CamelInternalProcessor
  */
 public class RestBindingAdvice implements CamelInternalProcessorAdvice<Map<String, Object>> {
+
+    private static final Logger LOG = LoggerFactory.getLogger(RestBindingAdvice.class);
     private static final String STATE_KEY_DO_MARSHAL = "doMarshal";
     private static final String STATE_KEY_ACCEPT = "accept";
     private static final String STATE_JSON = "json";
@@ -198,6 +202,7 @@ public class RestBindingAdvice implements CamelInternalProcessorAdvice<Map<Strin
         if (clientRequestValidation) {
             // check if the content-type is accepted according to consumes
             if (!isValidOrAcceptedContentType(consumes, contentType)) {
+                LOG.trace("Consuming content type does not match contentType header {}. Stopping routing.", contentType);
                 // the content-type is not something we can process so its a HTTP_ERROR 415
                 exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 415);
                 // stop routing and return
@@ -207,6 +212,7 @@ public class RestBindingAdvice implements CamelInternalProcessorAdvice<Map<Strin
 
             // check if what is produces is accepted by the client
             if (!isValidOrAcceptedContentType(produces, accept)) {
+                LOG.trace("Produced content type does not match accept header {}. Stopping routing.", contentType);
                 // the response type is not accepted by the client so its a HTTP_ERROR 406
                 exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 406);
                 // stop routing and return
@@ -507,6 +513,12 @@ public class RestBindingAdvice implements CamelInternalProcessorAdvice<Map<Strin
             return true;
         }
 
+        // Any MIME type
+        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept#Directives
+        if ("*/*".equals(target)) {
+          return true;
+        }
+
         boolean isXml = valid.toLowerCase(Locale.ENGLISH).contains("xml");
         boolean isJson = valid.toLowerCase(Locale.ENGLISH).contains("json");