Comments (5)
I'm starting to wonder if this is more of an issue with the NATS server (or CLI?) and the .NET client is correctly creating the mirror KV.
Command:
nats s view KV_stest-invoices
Seems to list things correctly.
Though getting the key from the mirror KV doesn't work:
from nats.net.v1.
This is an issue with mirroring or filter subjects. I'm not sure how to resolve this yet.
from nats.net.v1.
Just a quick addition. Instead of mirroring I tried to use stest as the source for stest-invoices. It is showing identical behaviour:
Here's the code:
using var conn = new ConnectionFactory().CreateConnection();
var kvm = conn.CreateKeyValueManagementContext();
var kvName1 = "stest";
var kvName2 = "stest-invoices";
var k1 = new KeyValueConfiguration.KeyValueConfigurationBuilder()
.WithName(kvName1)
.Build();
kvm.Create(k1);
var src = new Source.SourceBuilder()
.WithName(kvName1)
.WithFilterSubject("$KV.stest.invoice.*")
.Build();
var k2 = new KeyValueConfiguration.KeyValueConfigurationBuilder()
.WithName(kvName2)
.WithSources(src)
.Build();
kvm.Create(k2);
Here's the stream report:
And here's the info for the stest-invoices:
C:\>nats s info KV_stest-invoices
Information for Stream KV_stest-invoices created 2024-03-12 12:56:20
Replicas: 1
Storage: File
Options:
Retention: Limits
Acknowledgments: true
Discard Policy: New
Duplicate Window: 2m0s
Allows Msg Delete: false
Allows Purge: true
Allows Rollups: true
Limits:
Maximum Messages: unlimited
Maximum Per Subject: 1
Maximum Bytes: unlimited
Maximum Age: unlimited
Maximum Message Size: unlimited
Maximum Consumers: unlimited
Replication:
Sources: KV_stest
Source Information:
Stream Name: KV_stest
Subject Filter: $KV.stest.invoice.*
Lag: 0
Last Seen: 147ms
State:
Messages: 1
Bytes: 128 B
First Sequence: 1 @ 2024-03-12 12:56:30 UTC
Last Sequence: 1 @ 2024-03-12 12:56:30 UTC
Active Consumers: 0
Number of Subjects: 1
from nats.net.v1.
Sorry for spamming... As the last idea I tried using "subject transform".
Unfortunately the behavior is the same: bucket reports no keys even though they are in the stream.
from nats.net.v1.
It's subject filter issue. I used JetStream directly to read the messages.
In the stream for stest
StreamInfo{Created=3/12/2024 5:43:33 PMTimestamp=3/12/2024 5:50:05 PM, StreamConfiguration, Stream:KV_stest | Message Subject: $KV.stest.invoice.500 | Data: invoice
Stream:KV_stest | Message Subject: $KV.stest.inv.500 | Data: inv
In the stream for stest-invoices
DeletedCount=0, FirstTime=3/12/2024 5:43:33 PM, LastTime=3/12/2024 5:43:33 PM}, ClusterInfo=null, NATS.Client.JetStream.MirrorInfo, SourceInfos=}
Stream:KV_stest-invoices | Message Subject: $KV.stest.invoice.500 | Data: invoice
The subject for the message in stest-invoices does not match the subject for a key in that bucket, so any KV operation, either through the cli or the .NET client will never find the key. It needs to be transformed. I'm working on figuring how to do it.
from nats.net.v1.
Related Issues (20)
- IIterableConsumer.NextMessage: documentation does not match implementation of `timeoutMillis` parameter
- Be careful about breaking binary compatibility HOT 6
- Export match function HOT 2
- StreamReader in sendConnect eats half-completed INFO message packets HOT 6
- Nats client has a memory leak HOT 2
- Cannot stop ConnectionFactory from creating a connection when reconnectOnConnect = true HOT 1
- Implement PublishAsync HOT 1
- Implement Consumers Pause
- Add reconnect method HOT 1
- NatsJSConsume timeout when using Ordered Consumer (big gap between messages) HOT 2
- KeyValue atomic delete and purge methods HOT 1
- Heartbeat messages cause slow consumer HOT 3
- Ability to create connection with string credentials instead of from a file HOT 5
- NATSConnectionException: Authentication Timeout HOT 5
- [INF] Initiating Shutdown... HOT 1
- Passing consumer configuration in KV store subscription HOT 2
- Fix suppressed BouncyCastle known moderate severity vulnerability warning in TlsVariationsExample
- Add filtering to KV method returning all keys
- Not thread safe to start subscriptions concurrently in a connection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nats.net.v1.