mosermw commented on code in PR #8584:
URL: https://github.com/apache/nifi/pull/8584#discussion_r1693426178


##########
nifi-extension-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/PublishJMS.java:
##########
@@ -211,8 +212,12 @@ public class PublishJMS extends 
AbstractJMSProcessor<JMSPublisher> {
      */
     @Override
     protected void rendezvousWithJms(ProcessContext context, ProcessSession 
processSession, JMSPublisher publisher) throws ProcessException {
-        FlowFile flowFile = processSession.get();
-        if (flowFile != null) {
+        final List<FlowFile> flowFiles = 
processSession.get(context.getProperty(MAX_BATCH_SIZE).asInteger());
+        if (flowFiles.isEmpty()) {
+            return;
+        }
+
+        flowFiles.forEach(flowFile -> {

Review Comment:
   Thanks for looking at this @jrsteinebrey.  Great suggestion.  I did this for 
the vars you mentioned except for flowFileReader.  Creating flowFileReader 
outside the loop would require checking the RECORD_READER property both outside 
and inside the loop.  I can do it if you feel strongly about it, but the code 
felt ugly when I had it in there like that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to