Skip to content

Commit

Permalink
[pulsar-storm] allow option to configure queue size of pulsar-spout-c…
Browse files Browse the repository at this point in the history
…onsumer (apache#4239)
  • Loading branch information
rdhabalia authored and merlimat committed May 15, 2019
1 parent b0cb4af commit 815c8fa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public PulsarSpout(PulsarSpoutConfiguration pulsarSpoutConf, ClientBuilder clien
this.consumerConf.setTopicNames(Collections.singleton(pulsarSpoutConf.getTopic()));
this.consumerConf.setSubscriptionName(pulsarSpoutConf.getSubscriptionName());
this.consumerConf.setSubscriptionType(pulsarSpoutConf.getSubscriptionType());
this.consumerConf.setReceiverQueueSize(pulsarSpoutConf.getConsumerReceiverQueueSize());

this.pulsarSpoutConf = pulsarSpoutConf;
this.failedRetriesTimeoutNano = pulsarSpoutConf.getFailedRetriesTimeout(TimeUnit.NANOSECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class PulsarSpoutConfiguration extends PulsarStormConfiguration {

private SubscriptionType subscriptionType = SubscriptionType.Shared;
private boolean autoUnsubscribe = false;
private int consumerReceiverQueueSize = 1000;

/**
* @return the subscription name for the consumer in the spout
Expand All @@ -71,6 +72,19 @@ public void setSubscriptionType(SubscriptionType subscriptionType) {
this.subscriptionType = subscriptionType;
}

public int getConsumerReceiverQueueSize() {
return consumerReceiverQueueSize;
}

/**
* Receiver queue size of pulsar-spout consumer.
*
* @param consumerReceiverQueueSize
*/
public void setConsumerReceiverQueueSize(int consumerReceiverQueueSize) {
this.consumerReceiverQueueSize = consumerReceiverQueueSize;
}

/**
* @return the mapper to convert pulsar message to a storm tuple
*/
Expand Down

0 comments on commit 815c8fa

Please sign in to comment.