Skip to content

Commit 7cfc439

Browse files
Merge pull request #84 from nats-io/matthiashanel-patch-1
add test setup
2 parents 5b90e93 + 83cd5f4 commit 7cfc439

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

adr/ADR-19.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,39 @@ This is a side effect of JetStream having a two token API prefix and the materia
7676
This problem can be avoided by unifying the API name spaces to alway be two tokens with the second token being `API`, resulting in `$JS.API`, `$KV.API` and `$OBJ.API`.
7777
This however will not be backwards compatible.
7878

79+
## Testing
80+
81+
Here is a server config to test your changes. The prefix fo use is" `fromA`
82+
83+
```
84+
jetstream: enabled
85+
accounts: {
86+
A: {
87+
users: [ {user: a, password: a} ]
88+
jetstream: enabled
89+
exports: [
90+
{service: '$JS.API.>' }
91+
{service: '$KV.>'}
92+
]
93+
},
94+
I: {
95+
users: [ {user: i, password: i} ]
96+
imports: [
97+
{service: {account: A, subject: '$JS.API.>'}, to: 'fromA.>' }
98+
{service: {account: A, subject: '$KV.>'}, to: 'fromA.$KV.>' }
99+
]
100+
}
101+
}
102+
```
103+
104+
Test JetStream connected to account `I` talking to JetStream in account `A`: `nats account info -s "nats://i:i@localhost:4222" --js-api-prefix fromA`
105+
106+
KV publishes and subscribes need to support the prefix as well.
107+
Absent an actual implementation this is simulated with pub/sub.
108+
Your implementation needs to be able to connect to account I and access map ojbjects in Account A.
109+
110+
```
111+
nats -s "nats://a:a@localhost:4222" sub '$KV.map.>' &
112+
sleep 1
113+
nats -s "nats://i:i@localhost:4222" pub 'fromA.$KV.map.put' "hello world"
114+
```

0 commit comments

Comments
 (0)