Skip to content

Commit 147f48b

Browse files
committed
Update example
Signed-off-by: Byron Ruth <[email protected]>
1 parent d98d434 commit 147f48b

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

examples/issues/3724/cli/main.sh

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,32 @@ cat <<- EOF > origin.json
252252
}
253253
EOF
254254

255-
cat <<- EOF > mirror.json
255+
cat <<- EOF > hub-mirror.json
256+
{
257+
"name": "events-m",
258+
"retention": "limits",
259+
"max_consumers": -1,
260+
"max_msgs_per_subject": -1,
261+
"max_msgs": -1,
262+
"max_bytes": -1,
263+
"max_age": 0,
264+
"max_msg_size": -1,
265+
"storage": "file",
266+
"discard": "old",
267+
"num_replicas": 1,
268+
"mirror": {
269+
"name": "events"
270+
},
271+
"sealed": false,
272+
"deny_delete": false,
273+
"deny_purge": false,
274+
"allow_rollup_hdrs": false,
275+
"allow_direct": false,
276+
"mirror_direct": false
277+
}
278+
EOF
279+
280+
cat <<- EOF > leaf-mirror.json
256281
{
257282
"name": "events",
258283
"retention": "limits",
@@ -264,9 +289,9 @@ cat <<- EOF > mirror.json
264289
"max_msg_size": -1,
265290
"storage": "file",
266291
"discard": "old",
267-
"num_replicas": 2,
292+
"num_replicas": 1,
268293
"mirror": {
269-
"name": "events",
294+
"name": "events-m",
270295
"external": {
271296
"api": "\$JS.hub.API"
272297
}
@@ -281,10 +306,8 @@ cat <<- EOF > mirror.json
281306
EOF
282307

283308
nats --context hub-app stream add --config origin.json
284-
nats --context leaf-app stream add --config mirror.json
285-
286-
nats --context hub-app stream report
287-
nats --context leaf-app stream report
309+
nats --context hub-app stream add --config hub-mirror.json
310+
nats --context leaf-app stream add --config leaf-mirror.json
288311

289312
echo 'Starting bench...'
290313
nats bench \
@@ -299,7 +322,7 @@ nats bench \
299322
--multisubject \
300323
events
301324

302-
sleep 1
325+
sleep 2
303326

304327
# Report the streams
305328
nats --context hub-app stream report

0 commit comments

Comments
 (0)