aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2023-06-10 07:50:41 -0700
committerGitHub <noreply@github.com>2023-06-10 07:50:41 -0700
commitce227642dceffd3d014c23d096d08954a168f916 (patch)
tree2b889555514396cacddae4908a7320aa854e5de8 /src/main/java/org/traccar/MainModule.java
parentffbfba88830561b27e1d15857fed664f4b7813ba (diff)
parentdc22bc5feef7887d3baec1b2904fc18e1d067378 (diff)
downloadtrackermap-server-ce227642dceffd3d014c23d096d08954a168f916.tar.gz
trackermap-server-ce227642dceffd3d014c23d096d08954a168f916.tar.bz2
trackermap-server-ce227642dceffd3d014c23d096d08954a168f916.zip
Merge pull request #5107 from reajuria/feature/redis-broadcast
Feature/redis broadcast
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index 6a2fe21c3..b7bdbc6bf 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -28,6 +28,7 @@ import io.netty.util.Timer;
import org.apache.velocity.app.VelocityEngine;
import org.traccar.broadcast.BroadcastService;
import org.traccar.broadcast.MulticastBroadcastService;
+import org.traccar.broadcast.RedisBroadcastService;
import org.traccar.broadcast.NullBroadcastService;
import org.traccar.config.Config;
import org.traccar.config.Keys;
@@ -340,8 +341,15 @@ public class MainModule extends AbstractModule {
@Provides
public static BroadcastService provideBroadcastService(
Config config, ObjectMapper objectMapper) throws IOException {
- if (config.hasKey(Keys.BROADCAST_ADDRESS)) {
- return new MulticastBroadcastService(config, objectMapper);
+ if (config.hasKey(Keys.BROADCAST_TYPE)) {
+ switch (config.getString(Keys.BROADCAST_TYPE)) {
+ case "multicast":
+ return new MulticastBroadcastService(config, objectMapper);
+ case "redis":
+ return new RedisBroadcastService(config, objectMapper);
+ default:
+ break;
+ }
}
return new NullBroadcastService();
}