ivankelly commented on a change in pull request #2103: Issue 1433: Expose batch 
flushAsync() and flush() methods in Producer
URL: https://github.com/apache/incubator-pulsar/pull/2103#discussion_r200950535
 
 

 ##########
 File path: 
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java
 ##########
 @@ -2552,4 +2553,74 @@ public void testConsumerSubscriptionInitialize() throws 
Exception {
         log.info("-- Exiting {} test --", methodName);
     }
 
+    @Test
+    public void testFlushBatchEnabled() throws Exception {
+        log.info("-- Starting {} test --", methodName);
+
+        Consumer<byte[]> consumer = 
pulsarClient.newConsumer().topic("persistent://my-property/my-ns/test-flush-enabled")
+                .subscriptionName("my-subscriber-name").subscribe();
+
+        ProducerBuilder<byte[]> producerBuilder = pulsarClient.newProducer()
+                .topic("persistent://my-property/my-ns/test-flush-enabled")
+                .enableBatching(true)
+                .batchingMaxPublishDelay(1, TimeUnit.HOURS)
+                .batchingMaxMessages(10000);
+
+        @Cleanup
 
 Review comment:
   Use try-with-resource here. Achieves same as ```@Cleanup``` and is java 
standard.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to