We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Due to the difficulty of automating leaf node testing below are examples of tests/usage of mirroring and stream sourcing.
[Fact] public async Task Test_LeafStreamMirrorDomain() { await using var natsLeaf = new NatsConnection(new NatsOpts { Url = "nats://leaf:4223/", AuthOpts = new NatsAuthOpts { Username = "leaf", Password = "leaf" } }); await natsLeaf.ConnectAsync(); var jsContext = new NatsJSContext(natsLeaf); var mirroredStream = await jsContext.CreateStreamAsync(new StreamConfig() { Name = "mirroredStream", Mirror = new StreamSource { Name = "sourceStream1", Domain = "hub", }, }); } [Fact] public async Task Test_LeafStreamMultiSourceDomain() { await using var natsLeaf = new NatsConnection(new NatsOpts { Url = "nats://leaf:4223/", AuthOpts = new NatsAuthOpts { Username = "leaf", Password = "leaf" } }); await natsLeaf.ConnectAsync(); var jsContext = new NatsJSContext(natsLeaf); var mirroredStream = await jsContext.CreateStreamAsync(new StreamConfig() { Name = "mirroredStreamMulti", Sources = [ new StreamSource { Name = "sourceStream1", Domain = "hub" }, new StreamSource { Name = "sourceStream2", Domain = "hub" } ], }); } [Fact] public async Task Test_LeafKVMirrorDomain() { await using var natsLeaf = new NatsConnection(new NatsOpts { Url = "nats://leaf:4223/", AuthOpts = new NatsAuthOpts { Username = "leaf", Password = "leaf" } }); await natsLeaf.ConnectAsync(); var jsContext = new NatsJSContext(natsLeaf); var kvContext = new NatsKVContext(jsContext); var mirroredStore = await kvContext.CreateStoreAsync(new NatsKVConfig("mirroredKvTestMirror") { Mirror = new StreamSource { Name = "kvTest", Domain = "hub", }, }); } [Fact] public async Task Test_LeafKVMirrorSourcesDomain() { await using var natsLeaf = new NatsConnection(new NatsOpts { Url = "nats://leaf:4223/", AuthOpts = new NatsAuthOpts { Username = "leaf", Password = "leaf" } }); await natsLeaf.ConnectAsync(); var jsContext = new NatsJSContext(natsLeaf); var kvContext = new NatsKVContext(jsContext); var mirroredStore = await kvContext.CreateStoreAsync(new NatsKVConfig("mirroredKvTestSources") { Sources = [ new StreamSource { Name = "kvTest", Domain = "hub" }, ], }); }
Originally posted by @darkwatchuk in #631 (comment)
The text was updated successfully, but these errors were encountered:
rickdotnet
No branches or pull requests
Originally posted by @darkwatchuk in #631 (comment)
The text was updated successfully, but these errors were encountered: