Comments (13)
No, nothing is at 1.1 yet - feature list not complete either.
Try https://github.com/nats-io/jsm.go/compare/main...ripienaar:jsm.go:kv_topologies?expand=1
from natscli.
Looking at func mapStreamToKVS
in nats.go/jetstream/kv.go, I suspect that nats.go might have the same problem, because kv.pre
is not overwritten when info.Config.Mirror
exists but m.External == nil
. But I don't know Go and don't have Go dev.env. I know Python and tried nats.py, and couldn't do either "put" or "get" via a mirror.
Thanks in advance
from natscli.
hmm I see ADR-8 recently has received major updates regarding mirrors... should I read that first?
from natscli.
For mirrors you dont read from them, they are automatically used when reading - the nearest one is used and you cannot use them by name.
If you made a replica by source you could connect to it by name but we have no helpers for that. The only other option is there if you use leafnodes.
from natscli.
Sorry, correction, nats kv
does have --source
for source based replicas. Mirror as is should only be used with leafnodes and different domains.
from natscli.
thank you! so I should bind to a mirror only when its origin is in another domain.
I'm struggling to understand the test func TestKeyValueMirrorDirectGet
in nats.go (and tests in other clients are based on it too of course). Both PUTs and GETs are done on the TEST bucket, so how does it prove that the mirror actually responds to DIRECT.GET? I.e. if I remove js.CreateStream
from this test, it will nevertheless pass AFAICS.
sorry for off-topic, and probably questions like these belong to Slack. OTOH people can find answers on Github from googling.
from natscli.
You never can bind to a mirror - its subjects are just wrong. They are there for speeding up reads.
If you make a source based replicas as described in the recent edits to the ADR or using --source in the latest nats
release it will be something you can bind to as the messages inside will have been rewritten to have the right subjects.
I suspect the test is just not very good :)
from natscli.
You never can bind to a mirror
but this is exactly what func TestKeyValueMirrorCrossDomains
does! 😮
// Bind locally from leafnode and make sure both get and put work.
mkv, err := ljs.KeyValue(ctx, "MIRROR")
(proceeds with testing Put, Get and WatchAll)
from natscli.
Cross domains there's some special handling indeed, personally I'd avoid that. I dont want to support that method for a long time.
The source based method is right for all cases now.
from natscli.
ok, thank you so much for the clarification! I'll send everyone to read the updated ADR-8 :)
from natscli.
sorry for bothering you again, but do you know if any NATS client has (at least draft) implementation of ADR-8 v1.1, i.e. with the latest additions of KVAggregateConfig + KVAggregateOrigin ? I'd like to have some reference while implementing it. I thought that I might find it in some branch in nats.go, but nope =\
from natscli.
Thanks! I've implemented it - quite straightforward and indeed much cleaner than the previous approach with read and write subject prefixes that the client had to figure out based on a mirror configuration.
Do you mind if I provide some feedback about type KVAggregateOrigin
? I found it a bit confusing that Stream
is mandatory while Bucket
is optional, and so users need to remember to prefix the stream name with KV_. What about designing it the other way round, i.e. Bucket
is mandatory and Stream
is optional (only for the cases when we source from a mirror)? Then users don't need to remember about the "KV_" prefix.
You can see how it looks like here lines 159 (only Bucket
) and 198 (both Stream
and Bucket
). API docs here.
from natscli.
Thanks for the feedback, will check it out. The code I linked was pretty much just me making sure the spec can be implemented :) but will update there thank you!
from natscli.
Related Issues (20)
- nats str edit cannot update Subject Transform HOT 2
- A bug that was filed in nats.go HOT 2
- If user is set then token is not transmitted HOT 2
- Displayed ObjectStore digest is truncated HOT 1
- Not recognizing difference in stream configuration for sources HOT 1
- Support wildcard for KV get HOT 11
- Broken nats-cli arm64 binary HOT 3
- Stream info shows first and last timestamps incorrectly HOT 2
- Enable inactive-threshold flag while editing consumer HOT 2
- Can't create pull consumer from cli HOT 10
- Extend --trace or add a --debug flag to see server connections HOT 2
- req: set exit status based on: response / header existing
- Incorrect local JetStream store directory when $XDG_DATA_HOME is defined HOT 1
- Change `--completion-script-bash` option to `completion bash` by convention
- Add support for the s390x architecture HOT 1
- Context subcommand "create" missing from CLI Menu HOT 2
- sub: allow multiple subjects HOT 1
- Consider making a new release HOT 2
- Upload of large object fails with `nats: error: nats: stalled with too many outstanding async published messages`
- Consumer pause/resume commands fail after selecting stream/consumer
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 natscli.