1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
327 views
by brandon-w-8204 (34.1k points)
How can I discard messages with only whitespace (/r, /n, spaces)

1 Answer

0 votes

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());
}

by brandon-w-8204 (34.1k points)
...