File tree Expand file tree Collapse file tree
spellsource-protos/src/main/proto
spellsource-server/src/main/java/com/hiddenswitch/framework Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ dependencies {
2424}
2525
2626allprojects {
27- project. version = ' 0.10.5 '
27+ project. version = ' 0.10.6 '
2828}
2929
3030subprojects {
Original file line number Diff line number Diff line change @@ -37,9 +37,15 @@ message ServerConfiguration {
3737 string user = 3 ;
3838 }
3939
40+ message SentinelServers {
41+ repeated string sentinelAddresses = 1 ;
42+ string masterName = 2 ;
43+ }
44+
4045 oneof connection {
4146 HostPortUser hostPortUser = 1 ;
4247 string uri = 2 ;
48+ SentinelServers sentinelServers = 3 ;
4349 }
4450 }
4551
Original file line number Diff line number Diff line change @@ -98,10 +98,20 @@ public class Environment {
9898 }
9999
100100 private static RedissonClient redissonClientConstructor (Vertx vertx ) {
101- var configuration = getConfiguration ();
101+ var redisConf = getConfiguration (). getRedis ();
102102 var config = new Config ();
103- // todo: this should probably come out of the configuration, shouldn't it?
104- config .useSingleServer ().setAddress (configuration .getRedis ().getUri ());
103+ switch (redisConf .getConnectionCase ()) {
104+ case SENTINELSERVERS -> {
105+ var sentinel = redisConf .getSentinelServers ();
106+ var sentinelConf = config .useSentinelServers ().setMasterName (sentinel .getMasterName ());
107+ sentinel .getSentinelAddressesList ().forEach (sentinelConf ::addSentinelAddress );
108+ }
109+ case HOSTPORTUSER -> {
110+ var hpu = redisConf .getHostPortUser ();
111+ config .useSingleServer ().setAddress ("redis://" + hpu .getHost () + ":" + hpu .getPort ());
112+ }
113+ case URI , CONNECTION_NOT_SET -> config .useSingleServer ().setAddress (redisConf .getUri ());
114+ }
105115 return Redisson .create (config );
106116 }
107117
You can’t perform that action at this time.
0 commit comments