diff --git a/driver-nats/src/main/java/io/openmessaging/benchmark/driver/nats/NatsBenchmarkDriver.java b/driver-nats/src/main/java/io/openmessaging/benchmark/driver/nats/NatsBenchmarkDriver.java index c5b677f3..8071f36d 100644 --- a/driver-nats/src/main/java/io/openmessaging/benchmark/driver/nats/NatsBenchmarkDriver.java +++ b/driver-nats/src/main/java/io/openmessaging/benchmark/driver/nats/NatsBenchmarkDriver.java @@ -28,7 +28,6 @@ import io.nats.client.Options; import io.nats.client.PushSubscribeOptions; import io.nats.client.api.ConsumerConfiguration; -import io.nats.client.api.StorageType; import io.nats.client.api.StreamConfiguration; import io.nats.client.api.StreamInfo; import io.nats.client.support.JsonUtils; @@ -94,7 +93,8 @@ public CompletableFuture createTopic(String topic, int partitions) { StreamConfiguration.builder() .name(topic) .subjects(topic) - .storageType(StorageType.File) + .storageType(config.storageType) + .maxBytes(config.maxBytes) .replicas(config.replicationFactor) .build()); log.info("Created stream {} -- {}", topic, JsonUtils.getFormatted(streamInfo)); diff --git a/driver-nats/src/main/java/io/openmessaging/benchmark/driver/nats/NatsConfig.java b/driver-nats/src/main/java/io/openmessaging/benchmark/driver/nats/NatsConfig.java index f6770c98..d76a900b 100644 --- a/driver-nats/src/main/java/io/openmessaging/benchmark/driver/nats/NatsConfig.java +++ b/driver-nats/src/main/java/io/openmessaging/benchmark/driver/nats/NatsConfig.java @@ -13,8 +13,16 @@ */ package io.openmessaging.benchmark.driver.nats; + +import io.nats.client.api.StorageType; + public class NatsConfig { public String natsHostUrl; public int replicationFactor; + + public StorageType storageType = StorageType.File; + + // -1 is unlimited + public int maxBytes = -1; }