Github user ijokarumawak commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2362#discussion_r159791308
--- Diff:
nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublisherLease.java
---
@@ -71,9 +72,18 @@ void publish(final FlowFile flowFile, final InputStream
flowFileContent, final b
tracker = new InFlightMessageTracker();
}
- try (final StreamDemarcator demarcator = new
StreamDemarcator(flowFileContent, demarcatorBytes, maxMessageSize)) {
+ try {
byte[] messageContent;
- try {
+ if (demarcatorBytes == null || demarcatorBytes.length == 0) {
+ // Send FlowFile content as it is, to support sending 0
byte message.
+ final ByteArrayOutputStream bos = new
ByteArrayOutputStream();
--- End diff --
@markap14 Thanks for the advice. I switched to use StreamUtils as you
suggested.
---