Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NATS] Extend to support in-memory stream #370

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -94,7 +93,8 @@ public CompletableFuture<Void> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}