@@ -25,16 +25,16 @@ leafnodes: {
2525port: 14222
2626server_name: hengli_1
2727
28- accounts:{
29- hengli:{
28+ accounts: {
29+ hengli: {
3030 jetstream: enabled
3131 users:[
3232 {user: _hengliConnUser_, password: _hengliConnUser_}
3333 {user: hengli, password: hengli, permissions: {
34- publish:{
34+ publish: {
3535 allow:["hengli.to.wsw.test","\$ JS.API.>"]
3636 },
37- subscribe:{
37+ subscribe: {
3838 allow:["\$ JS.ACK.hengli_to_wsw_test.>","_INBOX.>"]
3939 }
4040 }}
@@ -44,7 +44,6 @@ accounts:{
4444EOF
4545
4646cat << - EOF > a_2.conf
47-
4847cluster: {
4948 name: hengli
5049 port: 15334
@@ -65,16 +64,16 @@ leafnodes: {
6564port: 14223
6665server_name: hengli_2
6766
68- accounts:{
69- hengli:{
67+ accounts: {
68+ hengli: {
7069 jetstream: enabled
7170 users:[
7271 {user: _hengliConnUser_, password: _hengliConnUser_},
7372 {user: hengli, password: hengli, permissions: {
74- publish:{
73+ publish: {
7574 allow:["hengli.to.wsw.test","\$ JS.API.>"]
7675 },
77- subscribe:{
76+ subscribe: {
7877 allow:["\$ JS.ACK.hengli_to_wsw_test.>","_INBOX.>"]
7978 }
8079 }}
@@ -106,16 +105,16 @@ leafnodes: {
106105port: 14224
107106server_name: hengli_3
108107
109- accounts:{
110- hengli:{
108+ accounts: {
109+ hengli: {
111110 jetstream: enabled
112111 users:[
113112 {user: _hengliConnUser_, password: _hengliConnUser_},
114113 {user: hengli, password: hengli, permissions: {
115- publish:{
114+ publish: {
116115 allow:["hengli.to.wsw.test","\$ JS.API.>"]
117116 },
118- subscribe:{
117+ subscribe: {
119118 allow:["\$ JS.ACK.hengli_to_wsw_test.>","_INBOX.>"]
120119 }
121120 }}
@@ -124,6 +123,7 @@ accounts:{
124123}
125124EOF
126125
126+ # Setup the hub cluster.
127127cat << - EOF > "b_1.conf"
128128http_port: 28222
129129cluster: {
@@ -141,33 +141,35 @@ leafnodes: {
141141port: 24222
142142server_name: wsw_1
143143
144- accounts:{
145- hengli:{
144+ accounts: {
145+ hengli: {
146146 jetstream: enabled
147147 users:[
148148 {user: _hengliConnUser_, password: _hengliConnUser_}
149149 ]
150150 exports:[
151151 {service: "\$ JS.hengli.API.>", response: stream},
152+ {service: "\$ JS.FC.>"},
152153 {stream: "deliver.hengli.wsw.>", accounts: ["wsw"]}
153154 ]
154155 },
155- wsw:{
156+ wsw: {
156157 jetstream: enabled
157158 users:[
158159 {user: _wswConnUser_, password: _wswConnUser_},
159160 {user: wsw, password: wsw, permissions: {
160- publish:{
161+ publish: {
161162 allow:["\$ JS.ACK.hengli_to_wsw_test.>"]
162163 },
163- subscribe:{
164+ subscribe: {
164165 allow:["_recv_wsw.hengli.to.wsw.test"]
165166 }
166167 }}
167168 ]
168169 imports:[
169- {service:{account:"hengli", subject: "\$ JS.hengli.API.>"}, to: "\$ JS.hengli.wsw.API.>"},
170- {stream:{account:"hengli", subject:"deliver.hengli.wsw.>"}}
170+ {service: {account:"hengli", subject: "\$ JS.hengli.API.>"}, to: "\$ JS.hengli.wsw.API.>"},
171+ {service: {account: "hengli", subject: "\$ JS.FC.>"}},
172+ {stream: {account:"hengli", subject:"deliver.hengli.wsw.>"}}
171173 ]
172174 }
173175}
@@ -190,33 +192,35 @@ leafnodes: {
190192port: 24223
191193server_name: wsw_2
192194
193- accounts:{
194- hengli:{
195+ accounts: {
196+ hengli: {
195197 jetstream: enabled
196198 users:[
197199 {user: _hengliConnUser_, password: _hengliConnUser_}
198200 ]
199201 exports:[
200202 {service: "\$ JS.hengli.API.>", response: stream},
203+ {service: "\$ JS.FC.>"},
201204 {stream: "deliver.hengli.wsw.>", accounts: ["wsw"]}
202205 ]
203206 },
204- wsw:{
207+ wsw: {
205208 jetstream: enabled
206209 users:[
207210 {user: _wswConnUser_, password: _wswConnUser_},
208211 {user: wsw, password: wsw, permissions: {
209- publish:{
212+ publish: {
210213 allow:["\$ JS.ACK.hengli_to_wsw_test.>"]
211214 },
212- subscribe:{
215+ subscribe: {
213216 allow:["_recv_wsw.hengli.to.wsw.test"]
214217 }
215218 }}
216219 ]
217220 imports:[
218- {service:{account:"hengli", subject: "\$ JS.hengli.API.>"}, to: "\$ JS.hengli.wsw.API.>"},
219- {stream:{account:"hengli", subject:"deliver.hengli.wsw.>"}}
221+ {service: {account:"hengli", subject: "\$ JS.hengli.API.>"}, to: "\$ JS.hengli.wsw.API.>"},
222+ {service: {account: "hengli", subject: "\$ JS.FC.>"}},
223+ {stream: {account:"hengli", subject:"deliver.hengli.wsw.>"}}
220224 ]
221225 }
222226}
@@ -238,33 +242,35 @@ leafnodes: {
238242port: 24224
239243server_name: wsw_3
240244
241- accounts:{
242- hengli:{
245+ accounts: {
246+ hengli: {
243247 jetstream: enabled
244248 users:[
245249 {user: _hengliConnUser_, password: _hengliConnUser_}
246250 ]
247251 exports:[
248252 {service: "\$ JS.hengli.API.>", response: stream},
253+ {service: "\$ JS.FC.>"},
249254 {stream: "deliver.hengli.wsw.>", accounts: ["wsw"]}
250255 ]
251256 },
252- wsw:{
257+ wsw: {
253258 jetstream: enabled
254259 users:[
255260 {user: _wswConnUser_, password: _wswConnUser_},
256261 {user: wsw, password: wsw, permissions: {
257- publish:{
262+ publish: {
258263 allow:["\$ JS.ACK.hengli_to_wsw_test.>"]
259264 },
260- subscribe:{
265+ subscribe: {
261266 allow:["_recv_wsw.hengli.to.wsw.test"]
262267 }
263268 }}
264269 ]
265270 imports:[
266- {service:{account:"hengli", subject: "\$ JS.hengli.API.>"}, to: "\$ JS.hengli.wsw.API.>"},
267- {stream:{account:"hengli", subject:"deliver.hengli.wsw.>"}}
271+ {service: {account:"hengli", subject: "\$ JS.hengli.API.>"}, to: "\$ JS.hengli.wsw.API.>"},
272+ {service: {account: "hengli", subject: "\$ JS.FC.>"}},
273+ {stream: {account:"hengli", subject:"deliver.hengli.wsw.>"}}
268274 ]
269275 }
270276}
@@ -275,42 +281,42 @@ EOF
275281# Start a server for each configuration and sleep a second in
276282# between so the seeds can startup and get healthy.
277283echo " Starting b_1..."
278- nats-server -c b_1.conf -P b_1.pid & # > /dev/null 2>&1 &
284+ nats-server -c b_1.conf -P b_1.pid > /dev/null 2>&1 &
279285sleep 1
280286
281287echo " Starting b_2..."
282- nats-server -c b_2.conf -P b_2.pid & # > /dev/null 2>&1 &
288+ nats-server -c b_2.conf -P b_2.pid > /dev/null 2>&1 &
283289sleep 1
284290
285291echo " Starting b_3..."
286- nats-server -c b_3.conf -P b_3.pid & # > /dev/null 2>&1 &
292+ nats-server -c b_3.conf -P b_3.pid > /dev/null 2>&1 &
287293sleep 1
288294
289295# Wait until the servers up and healthy.
290296echo ' Hub cluster healthy?'
291297curl --fail --silent \
292298 --retry 5 \
293- --retry-delay 1 \
299+ --retry-delay 2 \
294300 http://localhost:28222/healthz; echo
295301
296302echo " Starting a_1..."
297- nats-server -c a_1.conf -P a_1.pid & # > /dev/null 2>&1 &
303+ nats-server -c a_1.conf -P a_1.pid > /dev/null 2>&1 &
298304sleep 1
299305
300306echo " Starting a_2..."
301- nats-server -c a_2.conf -P a_2.pid & # > /dev/null 2>&1 &
307+ nats-server -c a_2.conf -P a_2.pid > /dev/null 2>&1 &
302308sleep 1
303309
304310echo " Starting a_3..."
305- nats-server -c a_3.conf -P a_3.pid & # > /dev/null 2>&1 &
311+ nats-server -c a_3.conf -P a_3.pid > /dev/null 2>&1 &
306312sleep 1
307313
308314
309315# Wait until the servers up and healthy.
310316echo ' Leaf cluster healthy?'
311317curl --fail --silent \
312318 --retry 5 \
313- --retry-delay 1 \
319+ --retry-delay 2 \
314320 http://localhost:18222/healthz; echo
315321
316322cat << - EOF > origin-stream.json
@@ -399,13 +405,9 @@ nats bench \
399405 --no-progress \
400406 hengli.to.wsw.test
401407
402- sleep 2
403-
404408# Report the streams
405409nats -s " nats://_hengliConnUser_:_hengliConnUser_@127.0.0.1:14222" \
406410 stream report
407411
408- sleep 2
409-
410412nats -s " nats://_wswConnUser_:_wswConnUser_@127.0.0.1:24222" \
411413 stream report
0 commit comments