Redlink LoadBalancer Demo
This Flow demonstrates how to create a set of consumers on separate stores both north and south of a producer store.
The producer store will randomly distribute the load to all of its consumer stores.
Have a play with the debug as it is running to understand how the notifications work.
[{"id":"e60de991.75ae48","type":"tab","label":"LoadBalancerDemo","disabled":false,"info":""},{"id":"10a6bd71.db2093","type":"redlink store","z":"e60de991.75ae48","listenAddress":"localhost","listenPort":"4001","southInsert":false,"peerAddress":"0.0.0.0","peerPort":443,"headers":[],"name":"MAO1","meshName":"mesh0","interStoreLB":false,"oldStore":true,"showRegistration":true,"showDebug":false,"outputs":2,"isUserCertificate":false,"userKey":"","userCertificate":"","x":160,"y":100,"wires":[[],["4898980a.701218"]]},{"id":"18e1fbef.1b99e4","type":"redlink store","z":"e60de991.75ae48","listenAddress":"localhost","listenPort":"4002","southInsert":false,"peerAddress":"0.0.0.0","peerPort":443,"headers":[],"name":"MAO2","meshName":"mesh0","interStoreLB":false,"oldStore":true,"showRegistration":true,"showDebug":false,"outputs":2,"isUserCertificate":false,"userKey":"","userCertificate":"","x":160,"y":220,"wires":[[],["e4c65c91.d78c"]]},{"id":"b7f11aaa.0b01f","type":"redlink store","z":"e60de991.75ae48","listenAddress":"localhost","listenPort":"4003","southInsert":true,"peerAddress":"0.0.0.0","peerPort":443,"headers":[{"ip":"localhost","port":"4004"}],"name":"MAO3","meshName":"mesh0","interStoreLB":true,"oldStore":true,"showRegistration":true,"showDebug":false,"outputs":2,"isUserCertificate":false,"userKey":"","userCertificate":"","x":160,"y":340,"wires":[[],["52d1af1b.3c14e8"]]},{"id":"96059982.61aa7","type":"redlink consumer","z":"e60de991.75ae48","name":"MyService","reNotifyInterval":1,"consumerStoreName":"mesh0:MAO1","intransit":1,"manualReadReceiveSend":false,"rateTypeReceiveSend":"none","rateReceiveSend":1,"rateUnitsReceiveSend":"second","nbRateUnitsReceiveSend":"","topicReceiveSend":"","cmd":"read","showStatsReceiveSend":false,"statsFrequencyReceiveSend":0,"showDebugReceiveSend":false,"outputs":3,"x":570,"y":100,"wires":[["2f3b095.c070ef6"],["525dccd4.05f8a4"],[]]},{"id":"4b3893d6.99e9dc","type":"redlink consumer","z":"e60de991.75ae48","name":"MyService","reNotifyInterval":1,"consumerStoreName":"mesh0:MAO2","intransit":1,"manualReadReceiveSend":false,"rateTypeReceiveSend":"none","rateReceiveSend":1,"rateUnitsReceiveSend":"second","nbRateUnitsReceiveSend":"","topicReceiveSend":"","cmd":"read","showStatsReceiveSend":false,"statsFrequencyReceiveSend":0,"showDebugReceiveSend":false,"outputs":3,"x":570,"y":220,"wires":[["e361744e.0e3e"],["55dee7b.7a98f18"],[]]},{"id":"2f3b095.c070ef6","type":"function","z":"e60de991.75ae48","name":"","func":"msg.payload='MAO1 is Alive';\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":40,"wires":[["96059982.61aa7"]]},{"id":"e361744e.0e3e","type":"function","z":"e60de991.75ae48","name":"","func":"msg.payload='MAO2 is Alive';\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":160,"wires":[["4b3893d6.99e9dc"]]},{"id":"4753721f.fd9a0c","type":"comment","z":"e60de991.75ae48","name":"Load Balancer goes here","info":"","x":410,"y":440,"wires":[]},{"id":"55dee7b.7a98f18","type":"debug","z":"e60de991.75ae48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":750,"y":220,"wires":[]},{"id":"525dccd4.05f8a4","type":"debug","z":"e60de991.75ae48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":750,"y":100,"wires":[]},{"id":"db90fcc9.e64c88","type":"redlink store","z":"e60de991.75ae48","listenAddress":"localhost","listenPort":"4004","southInsert":true,"peerAddress":"0.0.0.0","peerPort":443,"headers":[{"ip":"localhost","port":"4001"},{"ip":"localhost","port":"4002"}],"name":"Lucky","meshName":"mesh0","interStoreLB":true,"oldStore":true,"showRegistration":true,"showDebug":false,"outputs":2,"isUserCertificate":false,"userKey":"","userCertificate":"","x":420,"y":480,"wires":[["32f40411.23bebc"],["8cac1700.09f6e"]]},{"id":"bd0a46eb.7ada38","type":"redlink producer","z":"e60de991.75ae48","name":"A producer","producerStoreName":"mesh0:Lucky","producerConsumer":"MyService","producerTTL":15,"producerETT":300,"priority":0,"timeout":-1,"sendOnly":false,"manualRead":false,"enforceReversePath":true,"rateTypeSendReceive":"none","rateSendReceive":1,"rateUnitsSendReceive":"second","nbRateUnitsSendReceive":"","topic":"","cmd":"send","private":false,"ttl":null,"tba":null,"showDebug":false,"outputs":3,"notifyInterval":15,"x":610,"y":660,"wires":[["f777bcde.8dde1"],[],[]]},{"id":"f803c275.a44348","type":"inject","z":"e60de991.75ae48","name":"","topic":"","payload":"Hello LuckyMaoMao","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":660,"wires":[["16e21f9e.c02378"]]},{"id":"f777bcde.8dde1","type":"debug","z":"e60de991.75ae48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":850,"y":640,"wires":[]},{"id":"32f40411.23bebc","type":"debug","z":"e60de991.75ae48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":630,"y":460,"wires":[]},{"id":"cdd7eab4.395398","type":"inject","z":"e60de991.75ae48","name":"","topic":"listRegistrations","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":500,"wires":[["db90fcc9.e64c88"]]},{"id":"9121f5be.d39d28","type":"inject","z":"e60de991.75ae48","name":"","topic":"listStore","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":540,"wires":[["db90fcc9.e64c88"]]},{"id":"876fbe45.5dfea","type":"inject","z":"e60de991.75ae48","name":"","topic":"listServices","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":460,"wires":[["db90fcc9.e64c88"]]},{"id":"52d1af1b.3c14e8","type":"debug","z":"e60de991.75ae48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":350,"y":340,"wires":[]},{"id":"8cac1700.09f6e","type":"debug","z":"e60de991.75ae48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":630,"y":500,"wires":[]},{"id":"4898980a.701218","type":"debug","z":"e60de991.75ae48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":350,"y":100,"wires":[]},{"id":"e4c65c91.d78c","type":"debug","z":"e60de991.75ae48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":350,"y":220,"wires":[]},{"id":"16e21f9e.c02378","type":"trigger","z":"e60de991.75ae48","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"-250","extend":false,"units":"ms","reset":"","bytopic":"all","name":"","x":380,"y":660,"wires":[["bd0a46eb.7ada38"]]},{"id":"1b01f810.f116a","type":"redlink consumer","z":"e60de991.75ae48","name":"MyService","reNotifyInterval":1,"consumerStoreName":"mesh0:MAO3","intransit":1,"manualReadReceiveSend":false,"rateTypeReceiveSend":"none","rateReceiveSend":1,"rateUnitsReceiveSend":"second","nbRateUnitsReceiveSend":"","topicReceiveSend":"","cmd":"read","showStatsReceiveSend":false,"statsFrequencyReceiveSend":0,"showDebugReceiveSend":false,"outputs":3,"x":570,"y":340,"wires":[["5725b8f0.14fb28"],["24214e7e.fb54e2"],[]]},{"id":"5725b8f0.14fb28","type":"function","z":"e60de991.75ae48","name":"","func":"msg.payload='MAO3 is Alive';\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":300,"wires":[["1b01f810.f116a"]]},{"id":"24214e7e.fb54e2","type":"debug","z":"e60de991.75ae48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":340,"wires":[]},{"id":"5d634acc.e4f14c","type":"comment","z":"e60de991.75ae48","name":"South Service","info":"","x":150,"y":300,"wires":[]},{"id":"2fd46dc4.372eea","type":"comment","z":"e60de991.75ae48","name":"North Service","info":"","x":150,"y":60,"wires":[]},{"id":"65b06e57.f4d02","type":"comment","z":"e60de991.75ae48","name":"North Service","info":"","x":150,"y":180,"wires":[]}]