Use the following script on the source node in the preprocess script:
if (StringUtils.isBlank(new java.lang.String(bytesIn, 'UTF-8'))) {
bytesOut = null;
} else {
bytesOut = bytesIn;
}
if (bytesOut === null) { //When null, the message is discarded and no further processing is done
responseBytes = new java.lang.String('File does not contain any characters').getBytes(qie.getChannelEncoding());
}