.setRequestByteThreshold(1024L) .setDelayThreshold(Duration.ofMillis(10)) .setFlowControlSettings( FlowControlSettings.newBuilder() .setLimitExceededBehavior(LimitExceededBehavior.Ignore)
.setRequestByteThreshold(1048576L) .setDelayThreshold(Duration.ofMillis(50)) .setFlowControlSettings( FlowControlSettings.newBuilder() .setMaxOutstandingElementCount(100000L)
oldBatchSettings .toBuilder() .setFlowControlSettings( oldBatchSettings .getFlowControlSettings()
oldBatchSettings .toBuilder() .setFlowControlSettings( oldBatchSettings .getFlowControlSettings()
.setElementCountThreshold(4L) .setRequestByteThreshold(null) .setFlowControlSettings( FlowControlSettings.newBuilder() .setLimitExceededBehavior(LimitExceededBehavior.Block)
.setRequestByteThreshold(1048576L) .setDelayThreshold(Duration.ofMillis(50)) .setFlowControlSettings( FlowControlSettings.newBuilder() .setMaxOutstandingElementCount(100000L)
@Bean @ConditionalOnMissingBean(name = "publisherBatchSettings") public BatchingSettings publisherBatchSettings() { BatchingSettings.Builder builder = BatchingSettings.newBuilder(); GcpPubSubProperties.Batching batching = this.gcpPubSubProperties.getPublisher() .getBatching(); FlowControlSettings flowControlSettings = buildFlowControlSettings(batching.getFlowControl()); if (flowControlSettings != null) { builder.setFlowControlSettings(flowControlSettings); } return ifNotNull(batching.getDelayThresholdSeconds(), (x) -> builder.setDelayThreshold(Duration.ofSeconds(x))) .apply(ifNotNull(batching.getElementCountThreshold(), builder::setElementCountThreshold) .apply(ifNotNull(batching.getEnabled(), builder::setIsEnabled) .apply(ifNotNull(batching.getRequestByteThreshold(), builder::setRequestByteThreshold) .apply(false)))) ? builder.build() : null; }
/** Get a new builder. */ public static Builder newBuilder() { return new AutoValue_BatchingSettings.Builder() .setIsEnabled(true) .setElementCountThreshold(1L) .setRequestByteThreshold(1L) .setDelayThreshold(Duration.ofMillis(1)) .setFlowControlSettings( FlowControlSettings.newBuilder() .setLimitExceededBehavior(LimitExceededBehavior.Ignore) .build()); }
/** Get a new builder. */ public static Builder newBuilder() { return new AutoValue_BatchingSettings.Builder() .setIsEnabled(true) .setElementCountThreshold(1L) .setRequestByteThreshold(1L) .setDelayThreshold(Duration.ofMillis(1)) .setFlowControlSettings( FlowControlSettings.newBuilder() .setLimitExceededBehavior(LimitExceededBehavior.Ignore) .build()); }