Skip to content

Commit

Permalink
Set Block If queue full to false by default (apache#441)
Browse files Browse the repository at this point in the history
* Changed ProducerConfiguration blockIfQueueFull to false by default

* Fixed test cases
  • Loading branch information
jai1 authored Jun 2, 2017
1 parent d990b17 commit 5c6c9c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ public void testSimpleBatchProducerConsumer1kMessages() throws Exception {
consumer.close();

ProducerConfiguration producerConf = new ProducerConfiguration();
producerConf.setMaxPendingMessages(numMsgs + 1);
producerConf.setBatchingMaxPublishDelay(30000, TimeUnit.MILLISECONDS);
producerConf.setBatchingMaxMessages(numMsgsInBatch);
producerConf.setBatchingEnabled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.yahoo.pulsar.client.api.Message;
import com.yahoo.pulsar.client.api.MessageId;
import com.yahoo.pulsar.client.api.Producer;
import com.yahoo.pulsar.client.api.ProducerConfiguration;
import com.yahoo.pulsar.client.api.PulsarClientException;
import com.yahoo.pulsar.client.api.SubscriptionType;
import com.yahoo.pulsar.client.util.FutureUtil;
Expand Down Expand Up @@ -261,7 +262,9 @@ public void testConsumersWithDifferentPermits() throws Exception {
Consumer consumer2 = pulsarClient.subscribe(topicName, subName, conf2);

List<CompletableFuture<MessageId>> futures = Lists.newArrayListWithCapacity(numMsgs);
Producer producer = pulsarClient.createProducer(topicName);
ProducerConfiguration conf = new ProducerConfiguration();
conf.setMaxPendingMessages(numMsgs + 1);
Producer producer = pulsarClient.createProducer(topicName, conf);
for (int i = 0; i < numMsgs; i++) {
String message = "msg-" + i;
futures.add(producer.sendAsync(message.getBytes()));
Expand Down

0 comments on commit 5c6c9c3

Please sign in to comment.