BSH files are simple Java-like programs. Therefore you have a lot of options to implement load-balancing. The following example uses the tile x coordinate as indicator which server should be used:
String[]serverParts=newString[]{"a","b","c"};StringgetTileUrl(intzoom,intx,inty){Stringsp=serverParts[x%serverParts.length];return"http://" + sp + ".myserver.example/" + zoom + "/" + x + "/" + y + ".png";}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
When a map source uses "load balancing" with several servers, this can be easily specified in custom map source file in XML format, thanks to ServerParts parameter (see : https://mobac.sourceforge.io/wiki/index.php/Custom_XML_Map_Sources#serverParts )
On the other hand, if for any reason, script is in .bsh format, is there equivalent capability ? If yes, which syntax to use ?
Thanks in advance for your answers.
Last edit: Laurent Grenet 2019-07-11
BSH files are simple Java-like programs. Therefore you have a lot of options to implement load-balancing. The following example uses the tile x coordinate as indicator which server should be used:
OK. Many thanks !